---
title: "Adding pretty-print URLs"
date: "2015-01-28"
category: "wordpress"
slug: "adding-pretty-print-urls"
---

## Overview

Pretty-print URLs (also called _permalinks_) transform default WordPress URL patterns like `index.php?page_id=123` into clean, readable URLs such as `/wordpress/adding-pretty-print-urls`. This improves both navigation and SEO.

Enabling permalinks requires two steps: configuring your [[htaccess-guide]] file and selecting a permalink structure in WordPress.

![Permalinks before and after as seen in the browser.](kb-image:permalinks-before-after.gif)
*Permalinks before and after as seen in the browser.*

## Step 1: Configure .htaccess

1. Create a [[htaccess-guide]] file inside the [[where-is-site-content-served-from]] for your WordPress site if one does not already exist.
2. Add the following rewrite rules to the `.htaccess` file:

    <IfModule mod\_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\\.php$ - [L]
    RewriteCond %{REQUEST\_FILENAME} !-f
    RewriteCond %{REQUEST\_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    You can edit this file using **Files** > **File Manager** in the control panel.

## Step 2: Set Permalink Structure in WordPress

1. Log in to your WordPress admin portal (typically at `/wp-admin`, e.g. `http://example.com/wp-admin`)
2. Navigate to **Settings** > **Permalinks**
3. Choose a permalink structure under **Common Settings**
    - A recommended option is **Custom Structure** with the value `/%category%/%postname%/`, which prevents conflicts when multiple categories contain posts with the same title

        ![Custom permalink used on kb.apnscp.com.](kb-image:permalink-value-apis.png)
*Example custom permalink structure.*
4. Click **Save Changes**

## See Also

- WordPress Codex: [Using Permalinks](http://codex.wordpress.org/Using_Permalinks)
