Created
March 17, 2016 11:00
-
-
Save Langmans/76853e0ccaf37254439e to your computer and use it in GitHub Desktop.
get requested url when rewriteengine is on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
| $base = rtrim(str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])), '/'); | |
| $len = strlen($base); | |
| if (substr($url, 0, $len) == $base) { | |
| $url = substr($url, $len); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment