0
votes

I have installed my cakephp on a shared host server.

I always get a 404 error

The mod_rewrite looks like this

/home/user/public_html/cms/.htaccess

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

/home/user/public_html/cms/app/.htaccess

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

/home/user/public_html/cms/app/webroot/.htaccess

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

The url is http://server/~user/cms and the server path is /home/user/public_html/cms

1
Do you know your host supports mod_rewrite? - Gelatin
@Simon: Tag Wikis should probably not include links to questions, since the tag itself is supposed to serve as an index to those questions. - Robert Harvey

1 Answers

1
votes

you have to add the RewriteBase to remove http://server/~user/ from the url. cake does not work with ~ in the url