I know $_SERVER["REQUEST_URI"]; can be used to get the url of the current page, but this doesnt work if the URL is a htaccess URL rewrite.
How can I get the real (not rewritten) filename of the current php file?
For example I go to http://site.com/page/ it rewrites and displays http://site.com/page.php
$_SERVER["REQUEST_URI"]; will just give me the rewrite, I want the original.
You can use the php constant
__FILE__as in: