WordPress permalink error resolved.
Just a quick post to let you know of a solution to a problem i have encountered twice now when developing on clients servers over which i have no real control.
The issue arises when using WordPress and turning on ‘permalinks’, suddenly nothing works and you are shown a blank white page with the following error:
Forbidden, perhaps you need to change the file permissions for this document or upload an index page.
Now first things first, ..always check you have a .htaccess file at the root of your wordpress folder (you may need to refresh your file view as WordPress may have only just created it).
Assuming you are using the /%postname%/ custom link structure as i was your .htaccess file should look like this (this also assumes your WP installation is in the root directory of your domain, ..but this doesn’t really matter WP generates this code for you automatically anyway):
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
So assuming you have this correct permalink .htaccess file content and then like me it is still not working, …just add these two magic lines to the top of the file:
Options -Indexes
Options +FollowSymLinks
Now your completed .htaccess file will look like this:
Options -Indexes
Options +FollowSymLinks
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
…and work perfectly.
Comments
cheers – works a treat
Great post. Fixed my problem. Thanks
Why can’t they spell it out in the help documents like this… eureka, many thanks!
..because it is a server issue, ..well not issue, ..but ‘issue’ :) …it never happens on my mediatemple servers, ..only occasionally on clients server.
I am sure there is a fix i could implement that mean’t speaking to a disgruntled server admin in a small air-conditioned box in the basement of their offices …but i prefer this method.
Happy to help.
I have tried it. I uploaded it with the ftp program but, it still won’t work. when i tried to open it, it was blank white, same as before. Is it caused by the cache??
It should not be caused by the cache no, ..please let me know the following:
- does it work with permalinks turned off?
- if you put the following in your .htaccess file does it redirect to google (replace everything, ..it is just a test to see that your htaccess file is working)?
redirect 301 / http://www.google.com/
Let me know your findings,
Sorry for the delay in my responses, i am on an african island with no electricity until thursday.
Thanks dude. Fixed my problem when hosted on 123-reg.co.uk
Thank you! It worked perfectly!
where is this .htaccess file, I do not see one in my directory, what do I do if I do not have the file?
If you are using permanlinks successfully then the chances are your FTP program is not set to show hidden files (files with a . before them are hidden) which you should be able to change in the preferences, …otherwise, ..simply make it at the root of your wordpress install.
.htaccess is a very important and powerful file, perhaps read this article first http://www.freewebmasterhelp.com/tutorials/htaccess/
How does the htaccess file need to look when the WP installation is not in the root but in a folder (let’s say called ‘subfolder’)?
Thank you
With regards to the problem mentinoned in this post, ..the same, just in that subfolder that you are using as the WP root, rather than the domain root.
With regards to custom permalinks, ..WP generates the correct code for this in the permalinks menu option under settings.
Hope that helps.
Holy Jesus, this was frustrating. It was the symlinks line that got it working for me. Thanks for the post, it was one of many that I read, but the only one that worked.
Worked flawlessly – thanks!
Options -Indexes
Options +FollowSymLinks
did the trick!
Nice fix, thanks.
Hi, I used this on http://www.gbforklifts.co.uk and http://www.forkliftblog.co.uk works perfectly, they should really include this on the wp website its a great article.
Thanks
This worked now.
Thanks
This is great, worked perfectly first time on http://www.deionisedwatersourcegb.co.uk great website keep up the good articles.
Thanks for your help
Finally i solved my permalink error thanks to this great site. I had massive issue on my photography site which is http://www.asianweddingphotographyz.com
Thanks a lot for the nice fix.
Keep up this lovely website.