Satish Ravipati
Satish Ravipati

Reputation: 1449

Installing/Setting cakePHP on Server

I'm trying to setup my cakephp work on server Purchased godaddy shared server

when i go to my site http://xyz.com/cake/ I'm getting 404 error

The requested URL /xyz/cake/app/webroot/ was not found on this server.

anyhelp plz ??

Thanks,
Satish

Upvotes: 0

Views: 4055

Answers (1)

mensch
mensch

Reputation: 4411

You need to set the correct RewriteBase in your .htaccess if you're going to run Cake inside a subdirectory.

Both /xyz/cake/.htaccess and /xyz/cake/webroot/.htaccess (assuming /xyz/cake is the path to Cake and your app dir) need to be updated.

/xyz/cake/.htaccess:

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

/xyz/cake/webroot/.htaccess:

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

Upvotes: 5

Related Questions