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, 2019 in Azure by sabby
• 4,370 points
3,600 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>

Hope it helps!

If you want to become Azure solution architect, then join Azure online course today.

Thank you!!

answered Jun 28, 2019 by Perry
• 17,100 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
8,756 views
0 votes
2 answers

Which should i use for ASP.NET MVC Development: Windows Azure or Amazon EC2?

Both the cloud platforms have slightly varied ...READ MORE

answered Mar 7, 2019 in Azure by Prerna
• 1,960 points

reshown Mar 7, 2019 by Vardhan 1,179 views
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, 2019 in Azure by Prerna
• 1,960 points
3,004 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
2,243 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, 2019 in Career Counselling by Gitika
• 65,770 points
1,929 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, 2019 in Career Counselling by Gitika
• 65,770 points
16,374 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, 2019 in Career Counselling by Gitika
• 65,770 points
1,259 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 28, 2019 in Azure by Perry
• 17,100 points
1,677 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, 2019 in Azure by Perry
• 17,100 points
2,187 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP