Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP: URL rewriting is not properly configured on your server

When I try to run my project (made with cakephp framework), I receive this error:

URL rewriting is not properly configured on your server. Help me configure it I don't / can't use URL rewriting

I checked apache httpd.conf file and everything look ok. How can I fix this?

Thanks.

like image 923
Emanuel Avatar asked Aug 10 '11 16:08

Emanuel


1 Answers

Ugh. Before you go nuts testing out your Apache config, make sure cake.generic.css is available in your app/webroot/css/ folder. This is a very misleading error message.

The state of URL rewriting is being checked indirectly by checking for access to cake.generic.css (which would only be found if url rewriting is working).

The red error box in the default home.ctp is ALWAYS shown by default. Then the styling in cake.generic.css will hide it via

#url-rewriting-warning {
    display:none;
}

But that means if the cake.generic.css file is not found (e.g. because you deleted it to use your own CSS), the error box will not be hidden, even though URL rewriting is working perfectly fine.

So basically, ignore the URL rewriting error on the default homepage. Try to access one of your controller+views and see if it works.

like image 182
Costa Avatar answered Oct 01 '22 05:10

Costa