bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic Route not work on Hosting

pmtpro opened this issue · comments

Hello!

I really like fatfree, it really helps me a lot in my coding.

However, everything was fine until I put my product on Hosting.

Dynamic Route doesn't work as I expected, it always returns 404 error

My config:

GET /@controller/@action = App\Controllers\@controller->action@action
GET /@controller = App\Controllers\@controller->actionIndex

GET / = App\Controllers\Home->actionIndex

Only Home is working.

I also tried several other cases and only the latter worked
GET /Home/@action = App\Controllers\Home->action@action

Sounds like you didn't upload the .htaccess file to the server.

Sounds like you didn't upload the .htaccess file to the server.

Sorry, but I already uploaded .htaccess. My .htaccess

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]

Is the server using Apache?
Is the apache modrewrite turned on?

Does the server require you to use the reweite base rule?
RewriteBase /

Does the server require you to use the reweite base rule?
RewriteBase /

yes, but the result is still the same

when the hosts filesystem is case sensitive, also check the casing of file names. When you goto /home but the controller is named Home.php it may also fail.

when the hosts filesystem is case sensitive, also check the casing of file names. When you goto /home but the controller is named Home.php it may also fail.

Thank you very much
After I renamed the file everything worked! ^^!