Welcome Guest, Not a member yet? Register   Sign In
Redirecting www to non-www
#3

[eluser]alexbet[/eluser]
Hey CroNiX,

This works great, except for one small thing. When I type in the domain as www.domain.com and when I am redirected to the non-www domain, the URL in the address bar becomes the following:

http://domain.com/index.php/

Is there any way to take avoid having the "index.php" part in the URL when you are redirected? Here is what I have now in the htaccess file:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{HTTP_HOST} !^domain.com$
RewriteRule (.*) http://domain.com/$1 [R=301,L]

Thanks SO much! Smile
Alex


Messages In This Thread
Redirecting www to non-www - by El Forum - 05-26-2011, 05:41 PM
Redirecting www to non-www - by El Forum - 05-26-2011, 05:49 PM
Redirecting www to non-www - by El Forum - 05-26-2011, 06:15 PM
Redirecting www to non-www - by El Forum - 05-26-2011, 06:24 PM
Redirecting www to non-www - by El Forum - 05-26-2011, 06:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB