How to set up WordPress Pretty Permalinks in a Windows Environment Running IIS? Print

  • 0

Default WordPress URL looks like http://mydomain.com/?p=123, which is not a user-friendly SEO URL. So, to create SEO-friendly URLs, you can use WordPress Permalinks. After enabling the Permalinks, you will see the category, tag, title, and post in the URL while also using keywords inside the URLs. The following steps will help set up WordPress Pretty Permalinks in a Windows Environment Running IIS.

  1. Log in to your WordPress Admin - https://mydomain.com/wp-login.php.

  2. Go to Settings >> Permalinks.

  3. In Common Settings, choose the required permalink structure that you want to use.
    Here, we have selected the
    post name commonly used by SEO experts; the post name is the unique identifier to locate your WordPress post from the database.
    WordPress custom structure will also allow you to structure your website URL.



  4. Once you select the version, remove the /index.php and only add /%postname%/ and click the Save Changes button.
    In this case, if your WordPress page is named blog.php, it will show up as http://mydomain.com/blog/.

  5. Open the web.config file in IIS.
    It is an equivalent file of .htaccess in Linux cPanel. You can use FTP to access the web.config file or directly connect using the RDP.

  6. You can create the web.config file if it doesn't exist and add the code given below within your web.config file -
  1. <?xml version="1.0" encoding="UTF-8"?>

    <configuration>

        <system.webServer>

            <rewrite>

                <rules>

                    <rule name="WordPress   Rule" stopProcessing="true">

                        <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>

  2. 7. Save the file if you have connected it through RDP.
        You must save and upload this file if you use FTP.

    8. Access your WordPress website; now, it should show the page we discussed in point number 4.


Was this answer helpful?

« Back

chat