Featured Posts

Scumbag Culture - Part 2 "When integration is actually exclusion despite what the letter of the law says." Towards the end of 2009 I published the first of a planned series of articles on the tide of scumbag culture that is...

Read more

Facebook overtakes Google (Stateside) New figures from Hitwise reveal national domination for Facebook. For the week ending March 13, Facebook grabbed 7.07 percent of all U.S. web traffic, barely beating Google at 7.03 percent. This...

Read more

This is what the SAR Helicopter means to the Southeast Kayaker rescued off Wexford coast Tuesday, 30 March 2010 17:37 A man who was reported missing while kayaking off the coast of Co Wexford has been rescued by helicopter this evening. The...

Read more

Hero Problem on Meteor Network For some time now, anyone with their ears open will have heard of the "lock out" problem that is supposedly attributed to a 2G/3G handover issue on Meteor Ireland's network for all users of the HTC Hero....

Read more

It's Like Blogging a Dead Horse Regular readers (ahem, cough) will no doubt notice that my rate of updates has been somewhat stifled in recent times; I don't blog like I used to anymore. So, what's happened? Has everything in the...

Read more

Follow me on Twitter

WordPress Permalinks

Posted by jbwan | Posted in TSSG, Technology | Posted on 02-06-2007

View Comments

If like me you’ve run into the wonders of WordPress permalinks previously and hit brick walls such as 404 and 403 HTTP errors when you change from the default ?p=ID to the pretty /blog/2007/07/12/entry, then this post is for you and the many other people who have asked me this question previously. :) Not sure why considering the fact that I use MovableType as my blogging software but anyway!

Changing your permalink structure from the WordPress default to the pretty, year/month/day/entry-id or similar custom structure can cause problems for some people depending on the setup of their hosting infrastructure. [..]


In order to provide these pretty little URLs WordPress needs to make use of a clever little URL rewrite recipe for Apache. Usually this is provided for you by WordPress: It will either be entered into a .htaccess file automatically if permissions allow or it will be displayed at the bottom of the permalink update page. The code looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~jbwan/wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~jbwan/wordpress/index.php [L]
</IfModule>

Ideally the permissions should allow WordPress to update this file automatically but it’s not a disaster if they don’t. Either change the permissions on the .htaccess file in the root directory of your blog to fully writable by all (remember to make it safe again later by returning the original permissions) and run the WordPress permalink update page again or simply edit the file on the server if you have a shell account and add the lines above. This typically solves the problem for most folk and away they go.

While the previous step will remove the usual 404 errors it sometimes happens that this is not enough to solve the problem. There are two other potential problems that still remain and both will throw up either a 404 or a 403. If you are still getting a 404 trying to access the pretty permalink URLs then the problem is most likely the setup of your hosting provider. Chances are that they have not allowed overrides for the Apache setup relating to your domain, thus denying anything that you have written in the .htaccess file. If you have control of your server then simply edit the httpd.conf file relating to your site root or alternatively the user.conf file for an individual so that something like the following is present:

<Directory "/Users/jbwan/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

The important line here is the AllowOverride All which is most likely set to None if you are experiencing this problem. After editing either of these files you will need to have the Apache web server restarted. If however these lines are already in place and the error that you are experiencing is a 403 Permission Denied error then the problem can be solved through your own account without help from the hosting provider. The solution to this problem is to edit the .htaccess file in the root directory of your blog and add the following line to the top of the file before anything else:

Options +FollowSymLinks

This should solve the traversal problems that Apache is reporting through the 403 with navigating to the virtual directory and giving permissions to the web user to view the content. After that you should be flying and if not then you’ll need to contact your host to report a more serious problem. Happy permalinking! :)

  • Share/Bookmark

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  • http://applebox.com.au Simon

    Thanks!

  • http://www.jbwan.com/weblog Jonathan Brazil

    You’re welcome – I hope it did what you wanted and quickly rather than trawling through loads of junk on the web, like I did once upon a time. :)

  • Simon (another one)

    thanks – this helped a lot :-)

  • http://www.oes.ch Julian

    Thanks mate! Did not find a solution against the 403 error anywhere else!

  • http://www.jbwan.com/weblog Jonathan Brazil

    Happy to see that this quick help post is still helping people – still cannot believe that it’s not mentioned in WordPress’ documentation though as an FAQ given the number of hits I get for this and the number of other sites out there with parts of the solution.

blog comments powered by Disqus