Re: [symfony-users] [Symfony2] .htaccess for SEO (force non www, remove index.php from url)

2010-12-23 Thread gordonslondon
thanks for your response, all works perfectly with: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] # force url with no www RewriteCond %{HTTP_HOST} ^www\.([^.]+\.[^.]+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301] # force url with no

Re: [symfony-users] [Symfony2] .htaccess for SEO (force non www, remove index.php from url)

2010-12-23 Thread Jordi Boggiano
On Tue, Dec 21, 2010 at 9:56 PM, gordonslondon wrote: > For the first one i have (it's work great but when i go to > www.example.com/mypage it redirects to example.com/): > >   RewriteCond %{HTTP_HOST} ^www\.[a-z-]+\.[a-z]{2,6} [NC] >   RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC] >   Rewr

[symfony-users] [Symfony2] .htaccess for SEO (force non www, remove index.php from url)

2010-12-21 Thread gordonslondon
hi, the default symfony2 .htaccess is: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] know i want two things: 1. redirect *www.example.com* to *example.com* (force non-www or vice-versa) 2. redirect *example.com/index.php/mypage.html