lilmer Posted May 16, 2013 Share Posted May 16, 2013 Good day, I have to include www on my website and it works using this rewrite rules: <rewrite> <rules> <rule name="Redirect to www" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_HOST}" pattern="domain.com" /> </conditions> <action type="Redirect" url="http://www.domain.com/{R:0}" /> </rule> </rules> </rewrite> but the problem is it gives me an error of Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. Using google chrome. Quote Link to comment https://forums.phpfreaks.com/topic/278060-url-rewrite-non-www-to-www/ Share on other sites More sharing options...
Irate Posted May 16, 2013 Share Posted May 16, 2013 Pretty straightforward, the URL you are redirecting to keeps redirecting itself to its URL. Look into how an URL is made and post again? Quote Link to comment https://forums.phpfreaks.com/topic/278060-url-rewrite-non-www-to-www/#findComment-1430407 Share on other sites More sharing options...
xenLiam Posted May 23, 2013 Share Posted May 23, 2013 Try this. <rewrite> <rules> <rule name="Redirect to WWW" stopprocessing="true"> <match url=".*"> <conditions> <add input="{HTTP_HOST}" pattern="^domain.com$"> </add></conditions> <action type="Redirect" url="http://www.domain.com/{R:0}" redirecttype="Permanent"> </action></match></rule> </rules> </rewrite> Quote Link to comment https://forums.phpfreaks.com/topic/278060-url-rewrite-non-www-to-www/#findComment-1431801 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.