April 9, 2009
Toolbox
  • PDF
  • Listen

WordPress 2.7 and Permalink

WordPress Permalinks are the permanent URLs to your individual blog posts, pages, archives and other kinds of postings. Permalinks are the permanent URLs to your individual postings, which are supposed not to change. If permalink change, you will end up having missing links, page rank drop etc.

Now like its predecessor WordPress 2.7 got all the cool permalink features to make posting URI the way you like (well almost all logical variant). Example:-

wp-button Or if you don’t like anyone of those you can build your own custom URI structure using the fifth option, i.e. Custom, in that case you will need to use a number of tags specified by WordPress documentation.Apart from default permalink, all permalink settings will require following:

  • Apache web server with the mod_rewrite module installed
  • In WordPress’s home directory,
    • The FollowSymLinks option enabled
    • FileInfo directives allowed (e.g. AllowOverride FileInfo, AllowOverride All)
    • An .htaccess file (if this file is missing, WordPress will try to create it when you activate "pretty" permalinks)
    • If you want WordPress to update the .htaccess file automatically, WordPress will need write access to the file.

For Windows IIS server, consult to this article please.

Another cool stuff that was added back to WordPress 2.7 is usage of Post/Page slug to customize permalink. WordPress 2.5, 2.6 removed the post slug button from weblog interface. As a replacement, the “edit” link of Permalink was used for the purpose.

But WordPress 2.7 doesn’t show Post Slug interface by default. In order to display Post Slug text box, click the “Screen Option” on upper-right corner, go on and select “Post Slug” you will find the Post Slug input box at bellow the editor.

Problem 404!

Unfortunately recently I came across a mysterious permalink issue with WordPress 2.7 new installation, while working for a client. When I said mysterious, it really did gave me a hard time for an hour. After a bit googling I realized I wasn’t forgetting something at all, it’s a bug. For some weird reason kept getting 404 pages when I switched to pretty permalink after I install WordPress. To my surprise none of the permalink was working except only the default one, even after WordPress automatically generate and Write on .htaccess. I did all sorts of contingency procedures but hack result is always 404.

Solution

Some WordPress experts suggested this problem was caused by PHP ‘magic_quotes_sybase’, but unfortunately even after turning it off- most cases problem still remains same (since most cases it’s already turned off), 404! So I have to dig out for alternative solution that works every single time, not just once or twice. Here is the solution that working for me ever since I solved the issue:

  1. Delete the existing .htaccess if you have any from the server (Please do back it up).
  2. Change Back the blog/site’s Permalink to default through http://yoursite.com/wp-admin/options-permalink.php
  3. On a notepad file create a new .htaccess file with just one single line
    1
    RewriteEngine on
  4. Upload the .htaccess file on the server blog/site’s root directory and set the file permission to 777.
  5. Wait at least 2-3 minutes.
  6. Now change the permalink to whatever form you like using http://yoursite.com/wp-admin/options-permalink.php
  7. Wait another 2-3 minutes before you reload the blog pages/posts.
  8. Now all should be working. Change back the file permission of your .htaccess to 644.

Remember to replace http://yoursite.com with your blog/site url.

 
 
 
  • many many thanks for this one - brilliant!
  • I believe you are looking for this one: http://codex.wordpress.org/Giving_WordPress_Its_O...
  • hi
    i have a question please.
    I installed wordpress in a directory called "blog" i want that my permalinks be without the name of this category and points to the root directory where i have an other wordpress installed but use the same db that the first one. (_http://mysite/permalink and not _http://mysite/blog/permalink)

    how can i do that ?
    Thank you
blog comments powered by Disqus