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. 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? 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> 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
Archived
This topic is now archived and is closed to further replies.