Configure Windows Azure For URL rewrite using WordPress.

0 votes

I have just created a website using Windows Azure and their template for a WordPress blog. The site loads fine and all is well.

The problem though, comes when I try to get to a page with a permalink. Through WordPress configuration, I updated my permalinks to be in this format: http://www.myblog.net/blog/The-Post-Name-Is-Here. The problem with this is that when I attempt to go to that URL, I get this error:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

If I go to the shortlink for that same topic (e.g. http://www.myblog.net/?p=241), the page is found and all is well.

I have researched this quite a lot and have found that there is a url rewrite for apache, but that obviously won't work for me. I have also found that there is a url rewrite for IIS and I have played with this locally. You can configure this to properly manage the url rewrite. However, there is no such IIS panel in the Windows Azure Websites configuration portal.

I have also read a lot about editing web.config and htaccess, but neither of these files are in my wwwroot directory (or any child directories) for my website on azure.

So, does anyone know how to configure azure websites to manage permalinks properly?

Jun 28 in Azure by sabby
• 4,350 points
75 views

1 answer to this question.

0 votes

You need to understand that the configuration is done in a Web.config file, not in a .htaccess file. So first, in WordPress settings, change the permalink to a custom structure without "index.php", such as:

/%year%/%monthnum%/%day%/%postname%/

Also make sure in WordPress Settings, General Settings section, the WordPress Address (URL) and Site Address (URL) are correct.

Next, using FTP, WebMatrix or other tool, create a Web.config file in your WordPress site's root directory:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <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>

For a step-by-step tutorial, you can refer to Pretty WordPress Permalinks on Azure.

answered Jun 28 by Perry
• 17,020 points

Related Questions In Azure

0 votes
1 answer

How can we rewrite an URL in Azure Webapp?

You need to create a web.config file ...READ MORE

answered Jun 14, 2018 in Azure by null_void
• 3,220 points
837 views
0 votes
2 answers
0 votes
1 answer

How to set default Web page for a website on Microsoft Windows Azure?

This blog post should resolve your issue: http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx Look ...READ MORE

answered Mar 27 in Azure by Prerna
• 1,940 points
47 views
+1 vote
2 answers

How do I establish an connection to Azure IoT Hub? Say a connection like MQTT/AMQP using Python.

Azure IoT Hub comes with 3 SDK's: Service SDK Device ...READ MORE

answered Apr 13, 2018 in Azure by null_void
• 3,220 points
558 views
0 votes
3 answers

What is the job role of an Azure Developer?

Hi, Here are some job roles of an ...READ MORE

answered Jul 23 in Career Counselling by Gitika
• 25,340 points
87 views
0 votes
4 answers

What are the skill required for an Azure Developer?

Hi, The skills required for an Azure Developer ...READ MORE

answered Jul 23 in Career Counselling by Gitika
• 25,340 points
1,007 views
0 votes
3 answers

What is the salary offered to an Azure Developer?

Hi, For entry-level position starts at $87.750 per ...READ MORE

answered Jul 23 in Career Counselling by Gitika
• 25,340 points
71 views
0 votes
2 answers
0 votes
1 answer

How do I upload a picture to Windows Azure Website?

Check out this example: @model List<string> ...READ MORE

answered Jun 27 in Azure by Perry
• 17,020 points
49 views
0 votes
1 answer

How to register new users for MVC4 website on Azure AD?

The application holds the permissions to read/write ...READ MORE

answered Jul 3 in Azure by Perry
• 17,020 points
1,095 views