Enabling Permalinks in WordPress

KB68 Last reviewed 27 November 2013
Configuring WordPress to use pretty permalinks

By default, WordPress installations will use the format http://somedomain.com?p=1 for permalinks or links to individual posts and pages. This is not particularly visually useful or search engine (SEO) friendly. Our servers support the ability to use pretty or more visually comprehensive permalinks.

Configuring WordPress

To enable permalinks in your WordPress site, do the following:

  1. Log into WordPress with an account with Administrator user rights
  2. From the Dashboard menu, go to Settings > Permalinks
  3. On the Permalinks page, select Custom, specify below and enter /%year%/%monthnum%/%day%/%postname%/ into the Custom Structure textbox
  4. Click on the Save Changes button

Adding the Rewrite Rule

1. Download the web.config file from the root of your WordPress installation. You can do this either via FTP or through the Control Panel file manager.

2. The web.config file is an XML configuration file for your site. Paste the following following XML section in the system.webserver element. If there is already a WordPress rule present, overwrite it.

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

For example, for a simple WordPress installation, the complete web.config file will look something like this:

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

3. Upload the modified web.config to your website.

Testing the Permalinks

Visit your WordPress website. If you click on any of your post titles, you should now see that a permalink has been used.

3
Please wait, loading ...
Copyright © 2011 - 2017 Calzada Media Limited. All Rights Reserved.