This htaccess code will remove the ‘www’ part from the url. It uses the mod_rewrite module of apache to re-write the url – so make sure that’s installed.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com[NC]
RewriteRule ^(.*) http://domain.com/$1 [R=301,L]
Thanks you for this helpful code… WordPress was killing me, sometimes it worked, sometimes not, until I found out, that it depended on the written url: with www bad (header already send error), without fine, so your code was exactly what fixed my prob ^^
Hello Sir,
I have a dynamic site, the url structure is abc.xyz.com/State/sitemap/deep-link-page.html
So I want to drop the “sitemap” from the Url and the url structure should be
abc.xyz.com/State/deep-link-page.html
Can anyone suggest me the htaccess code so that it would be helpful for me.
Thanks in Advance
I’ve entered the line in .htaccess, but it has no effect. not even an error message
if I want to remove one link http://www.site.com/link_address.html ???