Magento – Redirected to the Homepage when removed www. from URL

magento-1.7overridesurl

Say, My Website is : www.example.com

I have one page : www.example.com/contactus

If I remove "www." from above url, means : example.com/contactus

It redirects me to the homepage. Why ??

Checkout Following Image of .htaccess :

enter image description here

What is the Solution for it ??

What changes i have to make in .htaccess

Best Answer

Your htaccess is kinda hard to read but nothing seems to redirect the user, I think it's your Magento baseurl that does that.

Have you tried adding the following code to the htaccess to redirect to www. on that level?

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Related Topic