开发者

PHP url after mod_rewrite

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜