Avatar of Craig Lambie
Craig Lambie
Flag for Australia

asked on 

adding www to URL with Wordpress, IIS and Mobile enabled sites (m.)

Hi Experts,

I have an issue with URL rewrite Module.
I am getting infinite loop issues.

Problem:
When I type in "truesecrets.com.au" I am getting infinite loop when I want it to 301 redirect to "http://www.truesecrets.com.au/strange-tours-melbourne/"
Also when I type in "m.truesecrets.com.au" I get the same error, it should redirect to "http://m.truesecrets.com.au/strange-tours-melbourne/"

Setup
IIS 7
Wordpress v3.2.1

WordPress address (URL): http://www.truesecrets.com.au/strange-tours-melbourne/
Site address (URL): http://www.truesecrets.com.au/strange-tours-melbourne/

Plugins Installed:
PrettyLink

Current IIS web.config rewrite rule
<rewrite>
			<rules>
				<rule name="Redirect /(.*) to /strange-tours-melbourne/(.*) " enabled="true" stopProcessing="true">                 
					<match url="(.*)" />                    
					 <conditions logicalGrouping="MatchAny">   
						<add input="{REQUEST_URI}" pattern="^/strange-tours-melbourne/(.*)$" negate="true" />                      
					 </conditions>  
					<action type="Redirect" url="http://{HTTP_HOST}/strange-tours-melbourne/{R:1}" appendQueryString="false" redirectType="Permanent" />                
				</rule> 
			</rules>
		</rewrite>

Open in new window


Resources I have read and tried out
http://brad.kingsleyblog.com/post/URL-Rewrite-Sample-to-Add-www-to-the-URL.aspx
http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
http://www.jtpratt.com/making-wordpress-permalinks-work-on-windows-iis-godaddy-without-mod_rewrite/

Your thoughts are appreciated.
Microsoft IIS Web ServerWordPressWeb Servers

Avatar of undefined
Last Comment
David Johnson, CD

8/22/2022 - Mon