Activating the Wordpress Permalink

Hi all,

I have created permalinks in my blog. Previously, I didn't know how to make it works because I guessed that it would work by just adding a .htaccess file in my blog directory. But it didn't work! So, here is the way to solve that problem (for your information, I use Apache 2.2.8 as web server with PHP 5.2.5 module installed here):
  1. When you activate your permalinks, make sure that you have set your .htaccess file to be writable (e.g.: by changing permission in command line interface with chmod 766 .htaccess). If your Wordpress application have permission to write your .htaccess file, its content will be:
    # BEGIN WordPress
    
    RewriteEngine OnRewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    

  2. Make sure that you have defined rewrite module in your Apache web server configuration (httpd.conf):
    
    RewriteEngine On
    RewriteRule   ^/~([^/]+)/?(.*) /u/$1/$2  [R]
    RewriteRule   ^/([uge])/([^/]+)$ /$1/$2/  [R]
    
    

  3. Do not forget to change the value of AllowOverride parameter in <Directory "[root_directory]" /> tag from None to All and also your Options parameter from None to Indexes FollowSymLinks as it will pay attention to your .htaccess file. Here is actually the key, because if you do not change this value, your .htaccess file will be useless. [root_directory] is the directory where you put your Wordpress source. So, the content of <Directory "[root_directory]" /> tag in your web server configuration file will be:
    
    Options -Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
    

  4. Restart your Apache web server via command line interface
    #apachectl restart
    

  5. Now, try to test your permalink

So, if your permalink activation is success, you do not have to access your blog post like this http://blog.knightdna.com/?page_id=k2, but you may access your blog into post date or category (it depends on your setting in permalink activation) like this http://blog.knightdna.com/2008/02/27. If you do not know how to activate your permalink, just go to your administration page. Select Options then select Permalinks. After it you may customize your permalink structure.

This is all my post about activating the Wordpress permalink, especially if your blog is not hosted on wordpress.com. I hope that this trick will be helpful for you. Happy surfing and have a nice day :D

-KnightDNA-
blog comments powered by Disqus