Mobile app version of vmapp.org
Login or Join
Deb1703797

: Changing www to point to non-www, instead of the opposite, using .htaccess I'm switching servers and need to change the following RewriteCond and RewriteRule commands in the .htaccess file. Right

@Deb1703797

Posted in: #Htaccess #ModRewrite #UrlRewriting

I'm switching servers and need to change the following RewriteCond and RewriteRule commands in the .htaccess file.

Right now I'm pointing domain.com to domain.com using:

RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^(.*)$ "http://www.domain.com/" [R=301,L]


I need to switch the commands and do the opposite, where I point domain.com to domain.com.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

You just need to change the URL structure in the same two lines:

RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ domain.com/ [R=301,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme