I am using URL re-writer module provided by http://urlrewriter.net/ site. Can anyone tell me how can I use there module to redirect www.example.com to example.com (301 redirect)
Thanks
I am using URL re-writer module provided by http://urlrewriter.net/ site. Can anyone tell me how can I use there module to redirect www.example.com to example.com (301 redirect)
Thanks
I've never used urlrewriter, but it looks like you'd use the following (or something similar:
<redirect url="^(.+)$" to="http://example.com/$1" permanent="true" />
on the www.example.com site.
<redirect url="http://www.example.com/(.+)$" to="http://example.com/$1">
If you just want to redirect www.example.com
:
<if header="HTTP_HOST" match="www.example.com">
<redirect url=".*" to="http://example.com$0" permanent="true" />
</if>
And if you want to redirect everything except example.com
to example.com
:
<unless header="HTTP_HOST" match="example.com">
<redirect url=".*" to="http://example.com$0" permanent="true" />
</unless>