开发者

PHP url after mod_rewrite

开发者 https://www.devze.com 2023-02-28 19:00 出处:网络
Is there a way to get the actual 开发者_StackOverflowurl of a file after mod_rewrite using PHP or Curl?

Is there a way to get the actual 开发者_StackOverflowurl of a file after mod_rewrite using PHP or Curl?

BASIC EXAMPLE

This --> example.com/test

I want this --> example.com/test.php


$_SERVER["REQUEST_URI"]; will give you original REQUEST_URI

$_SERVER["REDIRECT_URL"]; will give you redirected URL.

Assuming you are just using [L] in your rewrite rule.


Try $_SERVER['PHP_SELF'] with caveats and some alternatives as well: http://www.mc2design.com/blog/php_self-safe-alternatives

0

精彩评论

暂无评论...
验证码 换一张
取 消