Monday, October 3, 2011

Re: Force Trailing Slash and No WWW

Just use the code (before the CakePHP rules) on the first or the third .htaccess and you will be ok :)

Regards,
--
Thiago Belem
Desenvolvedor
Rio de Janeiro - RJ - Brasil

+55 (21) 8865.9250
thiagobelem.net
contato@thiagobelem.net

Skype / gTalk » thiago.belem.web
LinkedIn » br.linkedin.com/in/thiagobelem/pt
Assando Sites
, curso de CakePHP » assando-sites.com.br


On Mon, Oct 3, 2011 at 17:21, creat1v1ty <justin.r.rankin@gmail.com> wrote:
yeah, I'm familiar with the rewrite rule that would generally be used,
however I'm not sure how to do it within the Cake framework.

In Cake there are 3 .htaccess files:

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

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

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

In which of these files should I apply the non-www and trailing slash
rules?

--
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

--
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: