WordPress Permalink Optimization

WordPress Permalink Optimization

By default wordpress generate some ugly permalink structure that look like:  http://example.com/?p=319

Although short URLs are all the rage these days, WordPress’ default, query-string URLs aren’t as stylish as the permalink-based URLs: http://example.com/demo-link/

WordPress makes it easy to use the permalink-format for your URLs. Just visit Settings > Permalinks in the Admin, and then choose your permalink-format.

After doing this changes, you might get some unexpected errors with site URLS. To fix this problem add this below code in root .htacces file:

For root directory of wordpress installation ->

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

For sub directory of wordpress installation ->

RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]

Note: Don’t forget to change both “wordpress” with your real sub-directory name.

Published by

Emdad Khan

I am Emdad Khan, A WordPress Theme Developer and Author of BN Web Design Website. A full time Freelancer on WordPress Theme Development & Optimization as well as blogger.

Leave a Reply