Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Web.config for azure sites and wordpress

  • 11-06-2015 10:57PM
    #1
    Registered Users, Registered Users 2 Posts: 2,918 ✭✭✭


    Hi guys I hope this is the right section for this topic

    I have a wordpress site hosted on azure sites and I got a domain from godaddy, have that mapped correctly, but the permalinks are causing some hassle in wordpress.
    When i type mysite.com it works fine or mysite.com/link1 it loads correctly but when i click any links in the site it redirects to mysite.azurewebsites.net/link1

    here is my webconfig
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
      <rewrite><rules>
    		
    			<rule name="wordpress" patternSyntax="Wildcard">
    				<match url="*"/>
    					<conditions>
    						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
    						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
    					</conditions>
    				<action type="Rewrite" url="index.php"/>
    			</rule></rules></rewrite></system.webServer>
    </configuration>
    

    I tried adding something like this
    <httpRedirect enabled="true" destination="http://foo.com/" httpResponseStatus="Permanent" />
    

    it seems to be redirecting fine,but i'm getting a redirect loop error, does anyone have a solution to this or any easier solution to the problem as a whole?
    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    mightyreds wrote: »
    Hi guys I hope this is the right section for this topic

    I have a wordpress site hosted on azure sites and I got a domain from godaddy, have that mapped correctly, but the permalinks are causing some hassle in wordpress.
    When i type mysite.com it works fine or mysite.com/link1 it loads correctly but when i click any links in the site it redirects to mysite.azurewebsites.net/link1

    here is my webconfig
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
      <rewrite><rules>
    		
    			<rule name="wordpress" patternSyntax="Wildcard">
    				<match url="*"/>
    					<conditions>
    						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
    						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
    					</conditions>
    				<action type="Rewrite" url="index.php"/>
    			</rule></rules></rewrite></system.webServer>
    </configuration>
    

    I tried adding something like this
    <httpRedirect enabled="true" destination="http://foo.com/" httpResponseStatus="Permanent" />
    

    it seems to be redirecting fine,but i'm getting a redirect loop error, does anyone have a solution to this or any easier solution to the problem as a whole?
    thanks

    I think you need to perform DB Updates using SQL to update the pages and posts that have URLs on them. That's what we did anyway and it worked fine. Not difficult at all really


  • Registered Users, Registered Users 2 Posts: 2,918 ✭✭✭mightyreds


    Thanks John got that going all working well now


Advertisement