How Do You Configure Windows Azure For Url Rewrite Using WordPress?

前端 未结 2 1696
猫巷女王i
猫巷女王i 2020-12-31 14:23

I have just created a website using Windows Azure and their template for a WordPress blog. I was able to update the CNAME and Alias records to properly forward my domain to

相关标签:
2条回答
  • 2020-12-31 14:52

    WordPress on Windows Azure Websites runs under Microsoft Internet Information Services (IIS), not Apache. IIS also supports URL rewriting but the configuration is done in a Web.config file, not in a .htaccess file.

    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 refer to Pretty WordPress Permalinks on Azure. For additional information refer to Moving a WordPress Blog to Windows Azure – Part 4: Pretty Permalinks and URL Rewrite rules.

    0 讨论(0)
  • 2020-12-31 14:56

    if your wordpress blog is configured as www.myblog.net then in your permalink you can not have /blog until and unless you have changed that in your wordpress settings. I think your permalink should look somethimng like http://www.myblog.net/index.php/The-Post-Name-Is-Here

    Go to settings -> permalinks and either select one of the options from there. Or if you want custom url then type - /index.php/%postname%/ and save.

    0 讨论(0)
提交回复
热议问题