Hi,
I have a problem with my htaccess and hope someone can help me. I have a project with some domain aliases: the project is found under "www.my-site.de", but there are aliases like "mysite.de" or "my-site.at". To assure that every domain alias with or without leading "www" is redirected to one domain version ("www.my-site.de") I use the following setting in my htaccess:
RewriteCond %{HTTP_HOST} !^www\.my-domain\.de$
RewriteRule ^(.*)$ http://www.my-domain.de/$1 [L,R=301]
But: this redirects "m.my-site.de" - the wanted mobile subdomain - to "www.my-site.de" as well. Unfortunately I am not very familiar with regular expressions and htaccess so I want to ask here in this forum if someone can tell me how I could change these settings in order to assure that my project keeps being available under one domain except for the mobile subdomain.
Best,
Tobias
Comments
Comment #1
javiereduardo commentedtry:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Comment #2
devin carlson commentedMobile Tools 1.x is no longer supported. You may want to try javiereduardo's solution in #1.