I am trying to redirect my domain URL to www URL with htaccess.
It works great, but the problem is that it applies even on a subdomain.
My subdomain is adminpanel.mypage.com , but the rewrite engine rewrites even the subdomain at www.adminpanel.mypage.com/adminpanel/
which is strange, and I did not expect this to work. Any possible solution?
My code is:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
overwrites the engine already
source
share