| Posted: 19 September 2008 at 12:44pm | IP Logged
|
|
|
Ok.. I am brand new to this, and could not be more of a newb.
I think what I am trying to do is fairly simple and straightforward... but I need help getting started. I just installed Rewrite/2 on my 2003 server. My default httpd.ini file that was created is this:
[ISAPI_Rewrite]
# 3600 = 1 hour CacheClockRate 3600
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O] # Block external access to the Helper ISAPI Extension RewriteRule .*\.isrwhlp / [F,I,O]
I have about a dozen sites, and I need to put in a rule to redirect the non-www to www.
I added what I thought was the following default rule at the bottom for one of my many sites as a test:
[ISAPI_Rewrite]
# 3600 = 1 hour CacheClockRate 3600
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O] # Block external access to the Helper ISAPI Extension RewriteRule .*\.isrwhlp / [F,I,O]
# Move anything from non- www.example.com -> www.example.com # e.g. example.com -> www.example.com RewriteCond %HTTPS off RewriteCond Host: (?!^www.example.com)(.+) RewriteRule /(.*) http\://www.example.com/$2 [I,RP]
..of course I changed the www.myexample.com to one of my domain names www.mydomain.com, saved, tested, and while it worked for www.mydomain.com. It also set ALL of my domains pointing to www.mydomain.com. This immediately cracked me up, and also has now led me here.
Since I don't know what I'm doing, I don't know what I'm missing.
Basically I need this particular redirect for all my sites... So is my issue that I just need to add ALL of them in, and then each site address will resolve correctly? Or have I missed something obvious and simple in what I have done, with my single domain test attempt?
Thanks in advance!
|