non-www. to www. Redirects exclude domain
2 posts
• Page 1 of 1
non-www. to www. Redirects exclude domain
Hi everyone, i'm trying to exclude some domains and ip as an example from non www redirect, but i dont understand how.
this piece works as well(down here), but when i specialize domain for this redirect it's not works(#commented section), i need to create this redirect for domain
domain1.com
domain2.com
domain3.com
domain4.com
and NOT for
248.24.10.11
248.24.10.12
248.24.10.13
248.24.10.14
domain5.com
domain[N].com
Thank you!
this piece works as well(down here), but when i specialize domain for this redirect it's not works(#commented section), i need to create this redirect for domain
domain1.com
domain2.com
domain3.com
domain4.com
and NOT for
248.24.10.11
248.24.10.12
248.24.10.13
248.24.10.14
domain5.com
domain[N].com
- Code: Select all
#non-www. to www. Redirects
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !^m.domain\.com$ [NC]
#RewriteCond %{HTTP_HOST} ^domain1\.com$ [NC]
#RewriteCond %{HTTP_HOST} ^domain2\.com$ [NC]
#RewriteCond %{HTTP_HOST} ^domain3\.com$ [NC]
#RewriteCond %{HTTP_HOST} ^domain4\.com$ [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Thank you!
Re: non-www. to www. Redirects exclude domain
Hello.
Please try this:
Please try this:
- Code: Select all
#non-www. to www. Redirects
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !^m.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(?:domain1\.com)|(?:domain2\.com)|(?:domain3\.com)|(?:domain4\.com)$ [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests