Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evemilano/bab1035c19defb5a197fbab7b72e2f50 to your computer and use it in GitHub Desktop.
Save evemilano/bab1035c19defb5a197fbab7b72e2f50 to your computer and use it in GitHub Desktop.
Redirect m. to www (dedicated mobile to desktop)
# Esempio 1
RewriteCond %{HTTP_HOST} ^m\.esempio\.com$
RewriteRule ^\*$ http://www.esempio.com/*? [L,R=301]
# Esempio 2
RewriteCond %{HTTP_HOST} ^m\.esempio\.com$ [NC]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^\*$ http://www.esempio.com/*? [R=301,NE,NC,L]
# Esempio 3
RewriteCond %{HTTP_HOST} ^m\.esempio\.com$
RewriteRule ^$ http://www.esempio.com/? [L,R=301]
# Esempio 4
RewriteCond %{HTTP_HOST} !^(m\.)?esempio\.com$ [NC]
RewriteRule .* http://www.esempio.com%{REQUEST_URI} [R=301,L]
@evemilano
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment