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]
</IfMo开发者_如何转开发dule>
The url is http://server/~user/cms and the server path is /home/user/public_html/cms
you have to add the RewriteBase to remove http://server/~user/ from the url. cake does not work with ~ in the url
精彩评论