someone knows how can i redirect in the .htaccess this rules bellow ?
http://www.domain.com/index.php to http://domain.com
and
http://www.domain.com to http://domain.com
many tanks
someone knows how can i redirect in the .htaccess this rules bellow ?
http://www.domain.com/index.php to http://domain.com
and
http://www.domain.com to http://domain.com
many tanks
Since I'm guessing index.php
is what gets served when you go to your document root, you want to explicitly check that /index.php
is what is being requested, and not part of the URI, which it will be once the URL-file mapping pipeline does its thing.
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [L,R=301]
Then the www to non-www:
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]