I was recently working on a client’s site and came across this problem. I updated the default permalink structure to /%category%/%postname%/ and after hitting “Save Changes” I went to a Forbidden error page with no access to the admin panel. After searching and testing different solutions, here is the one that worked for me (note, you will need access to your web server):
Solution 1:
- Make sure that there is an .htaccess file in the root WordPress directory.
- Delete the current .htaccess file
- Upload a blank .htaccess file
- Set the permissions of that file to chmod 666 (or right-click the file in Dreamweaver and set the permissions to 666)
- Change the permalink structure to what you want.
- Change the chmod of .htaccess back to 644 (important for security.)
There were a couple of other solutions that people said have worked for them. I’m posting them here in the case that the above didn’t resolve your issue.
Solution 2:
Open your .htaccess file (you will probably need to download it locally and edit with Notepad).
If your WordPress installation is in a sub-directory, make sure it says the following, where subdir is the name of your sub-directory.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subdir/index.php [L]
</IfModule>
# END WordPress
If WordPress is installed in the root directory, make sure the .htaccess file says:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Solution 3:
If you’ve done the above and it still doesn’t work, try adding the following lines above the WordPress generated code:
Options -Indexes
Options +FollowSymLinks
So your edited .htaccess file will look like:
Options -Indexes
Options +FollowSymLinks
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Remembering to edit the .htaccess file to include the sub-directory if it applies.
Thanks for the help Solution 3 worked for me.
Thanks!!
Solution 3 as well for me.
hours ….
Another point for solution 3. Thanks for your help!
i got the same problem with my wordpress permalink, but i am a window user so there is no htacces file in my wordpress subdirectory but there is a file called wp_config.php, came to know that it is equivalent to htacces foe windows user, i ll be grateful if u can help me with this, i am awindows user, my sites host is hostgator
thank you in advance
I have also the problem, but I can say you, that the wp_config.php isn’t the same as the .htaccess
It has nothing to do that you are Windows user.
Most likely your .htaccess is hidden. Turn the hidden files on and you should be able to see it…
Greetings!
Solution 3 worked.
i searched so long. you saved my night.
Thank you so much for posting this.
My issue was that GoDaddy was creating an .htaccess file with incorrect permissions. I CHMODed my permissions of the .htaccess file to 0644 and that resolves it for me.
Just found this… and after scanning many other sites offering solutions to this (apparently common) problem, solution #2 worked for me. Thank you!
thank you very much! works like a charm! 3rd solution…
Very nice post, I walked through this and still had a problem, and found out that it was actually my ReWrite Mod was not on, from my PHP server. So I have to turn it on and restart it with “apache restart” from terminal with SSH.
Hats off to solution 3 – thank you Sir!
Thanks, Solution 3 did the job.
+1 for solution 3 ! worked , finally !