0

I have this weird behaviour where if the path does not contain a period (/whatever-something/a-page for example), the $_SERVER variable SCRIPT_NAME is replaced with index.html or index.php if they exist in the root folder. SCRIPT_NAME is the correct value: /whatever.something/a-page when there is no index.html or index.php in the root folder.

I check the SCRIPT_NAME value in the router_dev.php that Symfony provides.

I run the server like this: app/console server:run

Example 1 - GOOD

Directory structure:
web/index.html

Path:
/whatever.something/a-page

SCRIPT_NAME value:
/whatever.something/a-page

Example 2 - GOOD

Directory structure (empty):
web/

Path:
/whatever-something/a-page

SCRIPT_NAME value:
/whatever-something/a-page

Example 3 - WEIRD!

Directory structure:
web/index.html

Path:
/whatever-something/a-page

SCRIPT_NAME value:
/index.html

This causes my app to serve the index.html on basically every request that doesn't contain a period.

Can someone tell me what the hell is going on?

SaidbakR
  • 13,303
  • 20
  • 101
  • 195
Fabien Warniez
  • 2,731
  • 1
  • 21
  • 30

0 Answers0