Permalinks are neat looking urls, and turning on the permalinks option creates a virtual directory structure and gives you links such as http://example.com/wordpress/archives/2004/04/30/this-post instead of
http://example.com/wordpress/index.php?p=34
You can turn on Permalinks for your weblog at http://example.com/wordpress/options-permalink.php
To turn on and use Permalinks, your Apache server needs to have the mod_rewrite module compiled and available (which is the case for most webservers anyways)
Enter the desired structure for links in your Weblog using the Template Tags listed above on the same page, and hit “Update” to get a bunch of lines (rewrite rules) you can append to the .htaccess file in the root directory of your weblog.
The rewrite rules should be entered one per line, with no unwanted newlines in the middle of a rule, and without unwanted white-space. If you want to edit the .htaccess file using the “Templates” option, you should first change the permissions of the .htaccess file to 766, so that WordPress can save the changes you make to it through the Template editing interface. Consult the userguide or FAQ of the FTP software you use to find out how to have the software display “hidden” files, since .htaccess is a hidden file (the name begins with a “.", that’s why
), and also how to use the software to change file permissions.
The most common problems that arise while using Permalinks are the following browser errors :
403: Forbidden. This most likely means you(or the script you are trying to run) does not have permissions to the file or directory. Using the chmod command, in your FTP client or locally, try setting the file or directory you are trying to access to: 777 which means read, write, execute for all users. This is just to try and narrow down the problem however. MAKE SURE YOU CHANGE THIS AFTER. Something like 644 (read, write for the owner, read only for everyone else) should be sufficient for file permissions, and 755 for directories.
You could also try adding the following line at the top (the very first line) of .htaccess :
Options +SymLinksIfOwnerMatch
404: The well known ‘file not found’ error. You might get this while trying to enable permalinks. I have found that it is most likely due to having the wrong directory listed as your Rewrite Base in .htaccess. Wordpress says to use / but sometimes this is incorrect. For example on my server I need to use: Rewrite Base /home/adailyad/public_html/ Either call your ISP or just keep trying different paths till you get it. Running phpinfo.php (in your wordpress directory) might give you some hints, look for the path value.
500: This is a internal server error. Most likely caused by a mistake in your .htaccess file. It’s basically the server’s way of telling you that you tried something you aren’t allowed to do. Many people have trouble with mod_rewrite while trying to enable permalinks. Or you might have made a mistake writing an access rule.
If you are trying to turn on the Rewrite engine, and keep getting this error try this in your .htaccess file:
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /YOURPATHHERE
</ifmodule>
Notice the <ifmodule mod_rewrite.c> and the </ifmodule> commands. These are not given when Wordpress provides the code for permalinks. Add your directives and commands after the Rewrite Base and before the
(thank you, Clay )
If you are trying to get them to work . and can’t, try putting the following line at the top (very first line) of your .htaccess file
Options +FollowSymLinks
This is a server-specific thing, and might help in some cases.
For local installations, on a server in your desktop or laptop, try overriding Apache’s defaults by using the following at the top of your .htaccess (or by editing /etc/httpd/users/your_user_name.conf )
Options Indexes Includes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
If you have the following problem:
The image, and other file URIs in your posts show up wrong, as described in this support forum thread, that is, for example, an image in /weblog/images/xyz.gif gets redirected to /archives/yyyy/mm/dd/xx/images/xyz.gif or similar,
you can fix it by following this w3.org recommendation, which is to add a line that says:
<base href="http://www.youwebsite.com/"> in the head portion of your index.php file. This will set a base URL. You can then type and use relative links with reference to the specified base URL in your posts.
If all else fails , try using a filename-based Permalink structure, such as :
/index.php/archives/%year%/%monthnum%/%day%/%postname%/ in the wp-admin/options-permalink.php page.