This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Non WWW to WWW with exclusions in
Author
Message |
LesPiggot
Newbie


Joined: 12 March 2010
Location: United Kingdom
Posts: 2
Posted: 01 March 2012 at 8:25am

Hi everyone,

sorry another redirect query.

I'm trying to configure a 301 <domain_name> -> www.<domain_name>
with 6 exclusions for northamerica.<domain_name>, asia.<domain_name> etc.

Looking at the documentation and posts in the forums, I thought that

#Adds www to *.domain.tld domains unless the domain starts with www, africa, asia, easterneurope, middleeast, north/southamerica
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.|africa\.|asia\.|easterneurope\.|middleeast\.|northamerica\.|southamerica\.|)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

should work properly but I honestly not sure why its not. The .htaccess file is now about 3Mb in size due to other redirects being created (website moved from a legacy system)

Do I need to nest my OR conditions?
Can anyone give me any clues on how to resolve this

Thanks for your help in advance

Les

Back to Top
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 02 March 2012 at 5:53am

Hello Les,

Well, there're a lot of rules for tracing the log. Try commenting out the whole set, inserting your small subdomain set of rules and running a test.
Provide the rewrite.log for the testing request.

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version