Last Post
Popular Posts
Feed Analysis

 Powered by Max Banner Ads 

Permalinks don’t work

Written by Alfonso Muñoz on November 30, 2007 – 9:19 pm

Well now it works, but after installing WordPress in my web server I couldn’t customize them. for those of you who don’t know the importance of customizing permalinks here is an explanation. It makes your links more friendly. An example:

http://www.binaryant.com/?p=3
http://www.binaryant.com/2007/11/30/installing-wordpress/

Can you see the difference? These two links point to the same post ¿Why is better having permalinks like the second way? Because the search engines get extra imformation from the text of the links, and if a search robot pass through my links and analize them, the first link doesn’t tell him anything but the second one tells him that points to information about installing wordpress. For that reason is important to customize permalinks, to make your links more descriptive. You can reach permalinks panel in your admin panel Options > Permalinks

So ¿Why it didn’t work for me? Well permalinks is directly related to the mod_rewrite Apache module, so my first thought was I had this module inactive. I asked my hosting service and they told me it was active. So I went to the WordPress documentation and it was there. The reason was I didn’t have the .htaccess file. This file contains rules for the Apache server and tells Apache how to act in some situations, and in my case how to rewrite numeric links to customized links. As I said before I didn’t have it so I had to create one. And which rules did I need? Well my own WordPress told me the necessary ones when I tried to customize permalinks unsuccessfully. So I copied those rules to a .htaccess and uploaded to the server. Then all run perfectly. If you want to know which are the rules needed here they are:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Tags:
Posted in WordPress |

Leave a Comment