bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

Bug: Using route /app at begining doesn't find anything #1236

Closed natxocc closed 2 years ago

natxocc commented 2 years ago

Example:

$f3->('GET /app/first', 'Route->page'); Doesn't work $f3->('GET /first/app', 'Route->page'); Does work

Nothing with /app at begining does work

fmagrosoto commented 2 years ago

This is because .htaccess declaration.

RewriteEngine On RewriteRule ^(app|dict|ns|tmp)\/|.ini$ - [R=404] RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L,QSA] RewriteRule . - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Change the directories you want get access. For example:

RewriteRule ^(App|dict|ns|tmp)\/|.ini$ - [R=404]

Change app for App... and will work!

natxocc commented 2 years ago

This is because .htaccess declaration.

RewriteEngine On RewriteRule ^(app|dict|ns|tmp)/|.ini$ - [R=404] RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L,QSA] RewriteRule . - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Change the directories you want get access. For example:

RewriteRule ^(App|dict|ns|tmp)/|.ini$ - [R=404]

Change app for App... and will work!

Thanks for this detail! :-)