开发者

CakePHP on a Shared Hosting public_html

开发者 https://www.devze.com 2023-02-06 12:02 出处:网络
I have installed my cakephp on a shared host server. I always get a 404 error The mod_rewrite looks like this

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

0

精彩评论

暂无评论...
验证码 换一张
取 消