: How to redirect all mobile folder files to main folder file using htacess our previous website have one sub directory called "mobile". So in the main pages we write code if it is screen size
our previous website have one sub directory called "mobile". So in the main pages we write code if it is screen size less than 640px then got to mobile/ folder .
<link href="http://mobile.example.com/index.html/" media="only screen and (max-width: 640px)" rel="alternate" />
For example , someone take example.com/index.html website from mobile, they are redirected to mobile.example.com/index.html.
Now we developed new website that is responsive & in that files we remove the redirection code. But some people bookmark our previous mobile page url .
so we want to redirect all mobile.example.com/file to example.com/file .
How we can do this ?
m.example.com => example.com
m.example.com/index.html => example.com/index.html
m.example.com/about.html => example.com/about.html
m.example.com/anything => example.com/anything
More posts by @Marchetta884
1 Comments
Sorted by latest first Latest Oldest Best
Try this
RewriteEngine On
RewriteCond %{HTTP_HOST} m.example.com [NC]
RewriteRule ^(.*)$ www.example.com/ [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.