Wednesday, June 29, 2011

Uploaded cake to shared server, mod_rewrite woes

With no files uploaded into the site, my folder structure looks like
this in my FTP

-------------------------------------------------------
/
myusername/
www.mydomain.com/
-------------------------------------------------------

I uploaded everything from app/webroot into my webroot, which is the
www.mydomain.com folder

I also uploaded the app/ (without webroot) and cake/ folders into the
same folder so I have something like:

-------------------------------------------------------
/
myusername/
www.mydomain.com/
app/
cake/
css/
img/
etc.....
index.php
.htaccess
etc....
-------------------------------------------------------

Now, the frontpage of my site works fine, but when I navigate to any
other page I get a 404 error

-------------------------------------------------------
The requested URL /index.php was not found on this server.
-------------------------------------------------------

In my .htaccess file

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

After a bit of googling, I think that I need to add a RewriteBase
line, but I cant figure out what to put. I think ive tried every
combination I can think of but to no avail.

One thing that may be of note is that we do not have this site/host/
server connected to my domain name yet, as I wanted to get it all
configured before I risked losing the old site, so Im actually
accessing it by something like:

http://www.mywebhost.com/www.mydomainname.com

Also, do I need to change the /app/.htaccess file which also mentions
webroot?

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

Any ideas?

Cheers

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: