I've recently set up the start of a cakephp 2.0 site on a subdomain of
my hosting account after getting things working about how I wanted
them on my localhost.  The subdomain is in /var/subdomains/
sitename.myhost.com with a symbolic link to /var/www/html/sitename/app/
webroot (the document root).

I was having an issue with getting anywhere but the front page. For
example, if I tried to go to mysite.myhost.com/projects I would get a
too much recursion error.  I could get there if I used
mysite.myhost.com/index.php/projects however.  So I altered
the .htaccess file in webroot to read:

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


This worked fine.  I could go to sitename.myhost.com/projects and see
the project listing, I could go to sitename.myhost.com/admin/articles
and manage articles.  The only odd annoyance was that the Helpers give
me an address featuring index.php.  For instance, a pagination link in
the projects admin comes out as
http://sitename.myhost.com/index.php/admin/admin/projects/index/sort:description/direction:asc,
when obviously there shouldn't be an index.php in there, or two
instances of admin.  If I can get it to simply display the right
address in there, then I'm perfectly content with how everything else
is working.  If there is someone who is just better at
writing .htaccess files than me and spots a mistake I've made, please
do tell!  Here's the .htaccess that is in my /app directory, for
reference:

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

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to