Skip to content

Instantly share code, notes, and snippets.

@gooh
Created November 12, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gooh/247b90b840ddf28c7fb1cb73e1d3b269 to your computer and use it in GitHub Desktop.
Save gooh/247b90b840ddf28c7fb1cb73e1d3b269 to your computer and use it in GitHub Desktop.

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