Add WWW to the domain name

Dec 21, 2009 at 6:03 PM


I would like to have script with the help of Isapi that can add www to beginning to each domain name.

eg. -> ->




Dec 21, 2009 at 6:21 PM

Sudhir, this is in the documentation.  There's an example that does this.  Good luck!


Dec 21, 2009 at 6:46 PM

I tried this but that doesn't work.

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RedirectRule ^/(.*)$$1 [R=301]

If possible please give me exact correct script.



Dec 21, 2009 at 11:00 PM

There is no other answer, Sudhir.   I suspect IIRF is not installed properly. Check the logfile, Verify that the iirfstatus is ok, etc.  Do other rules work? Before troubleshooting the redirect, Do you have any reason to believe IIRF is installed and operating?


Dec 21, 2009 at 11:31 PM


Other rules works fine e.g.

RewriteRule ^/FolderName/(.*)$ /FolderName/Foldername1/$1 [I,L]
RedirectRule ^/FolderName/FolderName1/PageName.aspx(.*)$    /FolderName/$1   [R=302]

Except this rule that i wrote earlier not working. ->
It's work only when you are using only domain name and not after wards any fodler or file name.

I also checked your other post where you are recommening to use this Rule, but that also doesn't work.

RewriteCond  %{HTTP_HOST}  ^domain\.com$
RedirectRule ^/(.*)$       http:/$1         [R=301]



Dec 22, 2009 at 2:35 AM

Check the logfile - what does it tell you?