Skip to content

Instantly share code, notes, and snippets.

@gooh

gooh/AliasMatch.md Secret

Created Nov 12, 2019
Embed
What would you like to do?

I am curling http://localhost:8600/sample-a-0-foo. This will trigger this AliasMatch directive on the Apache:

^/sample-a-0(.*)$ /home/www/8600/docroot/test.php/$0​ 

So it gets translated to /home/www/8600/docroot/test.php//sample-a-0-foo. This results in PHP's $_SERVER["SCRIPT_NAME"] to be empty.

Curling http://localhost:8600/sample-a-1-foo will trigger

^/sample-a-1(.*)$ /home/www/8600/docroot/test.php/$1 

This gets translated to /home/www/8600/docroot/test.php/-foo. This results in PHP's $_SERVER["SCRIPT_NAME"] to be /sample-a-1-foo.

Why is SCRIPT_NAME empty in the first case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.