Forum Moderators: open

Message Too Old, No Replies

Using .htprotect to redirect

Redirecting non-www pages on IIS

         

TearingHairOut

4:41 pm on Nov 7, 2005 (gmt 0)

10+ Year Member



I want to set up a redirect from the non-www version of my domain name to the www version, e.g. domain.com is redirected to www.domain.com.

I am on shared IIS hosting, using H-Sphere control panel. My hosting provider says that a .htprotect file will work the same as a .htaccess would in *nix.

If I put the code

RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.MY_DOMAIN\.com [NC]
RewriteRule ^(.*) [MY_DOMAIN.com...] [L]

into the .htprotect, will it be successful?

If not, how should I write it?

I got that code from a post in the thread discussing the current 'Jagger' Google update.

bill

4:20 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



TearingHairOut I was hoping that someone would get back to you about using .htprotect, but it doesn't seem that many have experience with this. (This thread is already #2 on Google for .htprotect) .htprotect looks like it's a script to password protect pages. I'm not sure how it would work like .htaccess. Anyone?