Search code examples
apachecakephplocalhosteasyphp

CakePHP and EasyPHP URL rewriting


I'm tring to get CakePHP 2.2.3 working with EasyPHP 12.1 on my local machine. I'm getting an error from Cake that says:

URL rewriting is not properly configured on your server.

  1. Help me configure it please
  2. I don't / can't use URL rewriting

I followed all of the instructions on the 'Help me configure it' page with no success. I've just installed both EasyPHP and Cake and have only modified the http.conf file.

I also created a virtualhost using EasyPHP's built in form.


Solution

  • Check if your .htaccess files are these. First, in your root directory:

    <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteRule    ^$ app/webroot/    [L]
       RewriteRule    (.*) app/webroot/$1 [L]
    </IfModule>
    

    In app directory:

    <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteRule    ^$    webroot/    [L]
       RewriteRule    (.*) webroot/$1    [L]
    </IfModule>
    

    And webroot directory:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>