I'm trying to install cakePHP on a shared hosting setup. After extracting the files to a location like ~/public_html/dev/cake and visiting the appropriate URL (in this case http://hostname/~username/dev/cake/), I receive a 404 error:
The requested URL /usr/home/username/public_html/dev/cake/app/webroot/ was not found on this server.
I suspect that the reason for this is that upon closer inspection, the absolute path to ~/public_html is not in fact /usr/home/username/public_html, but rather /usr/www/users/username/.
Here's what I've been trying (but obviously it's not working): (~/public_html/dev/cake/app/webroot/.htaccess)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /usr/www/users/username/dev/cake/app/webroot/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
Unfortunately, this doesn't seem to change anything (the 404 message remains that same). Thoughts?
Shouldn't
RewriteBase /usr/www/users/username/dev/cake/app/webroot/
be
RewriteBase /~username/dev/cake/
RewriteBase
cares about mapping real urls to virtual ones, and I think that's what you want.
You're modifying the wrong file. The .htaccess file you need to modify is found in /dev, you shouldn't be modifying the one in /dev/cake/app/webroot/.htaccess
I just want to point out that I THOUGHT the module was loaded because I saw the code but apparently it was not enabled!
To enable it in SSH (terminal) type the following command
sudo a2enmod rewrite
The command below shows all modules that are active, if it appears in the list then you have it installed.
apache2ctl -M
Make sure to restart the server with...
service apache2 restart
PhpCake should start working now.
Why not just extract the files to /usr/www/users/username/
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With