Facebook LinkedIn Wordpress Tumblr Twitter

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 still didn't work! So, here is the way to solve that problem (for your information, I'm using 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've set your .htaccess file to be writable (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. You could try to test your permalink now

If your permalink activation is successful, you do not have to access your blog post like this following URL http://blog.knightdna.com/?page_id=k2, but instead you could access your blog based on post date or category (it depends on your setting in permalink activation), for instance http://blog.knightdna.com/2008/02/27. In case you do not know how to activate your permalink, just go to your administration page. Select Options then select Permalinks. Afterwards, you may customize your permalink structure.

That's all about activating the Wordpress permalink, especially if your blog is not hosted on wordpress.com. Hope this trick could be useful for you. Thanks and happy surfing! :D

-KnightDNA-
blog comments powered by Disqus