WordPress throws 403 forbidden error on wamp apache when enabled permalink?

I have setup a wordpress website on which I enabled permalink to open the pages with seo friendly urls. So it changed my .htaccess as below

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

But now when I try to access the website on localhost, it throws error as

Read More
Forbidden

You don't have permission to access /my_blog/ on this server.

I tried to look into the apache error logs and found this

[Thu Sep 19 22:33:29 2013] [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: D:/www/brt_blog/, referer: http://localhost/

So to fix this what I did is, I added below line before # BEGIN WordPress

Options FollowSymLinks

And that got fixed and site worked fine with seo friendly urls.

But the main issue is, it seems that there is some misconfiguration or some kind of security set on apache under wamp on my system. As every time if I create any site with the htaccess file having this code, it throws same 403 Forbidden error.

<IfModule mod_rewrite.c>
RewriteEngine On
.... my rewrite rules here...
</IfModule>

Here is the link to my httpd.conf file on apache, just in case anybody need to check it.
http://pastebin.com/LFxNTsnR

Related posts

Leave a Reply

2 comments

  1. I did a search, and I found a few issues that could cause this problem.

    A 403 message means it’s a permission error. The error can be caused because of something missing in the .htaccess file like Options +SymLinksIfOwnerMatch at the top of the .htaccess file, or the permalink format string from/%year%/%monthnum%/%day%/%postname%/ to /archives/%year%/%monthnum%/%day%/%postname%/.

    I found a bunch of people with this issue doing a search on Google for ‘permalink 403 error’.
    http://wordpress.org/support/topic/permalink-403-error

    Try changing the httpd.conf file as such:
    In your httpd.conf (or one of the included .conf files) is a reference to your website directory. It will look something like this:

    <Directory "/var/www/path/to/your/web/dir">
      Options ...
      ...
      etc.
    </Directory>
    

    Add the mod_rewrite directive in between the tags to enable the permalink feature in your site:

    <Directory "/var/www/path/to/your/web/dir">
      ...
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>
    </Directory>
    

    For more permalink control without .htaccess support, install the redirection plugin. Without a valid .htaccess file, the options will trigger an error that I’m sure you can safely ignore. At least it worked on my test server.

  2. using bitnami wamp, in my virtualhost I had:

    <Directory "path-to-site">
        Options Indexes FollowSymLinks
        AllowOverride All
        Options None # observe this line 
        Require all granted
    </Directory>
    

    I changed it to:

    <Directory "path-to-site">
        Options Indexes FollowSymLinks
        AllowOverride All
        Options all # set to all and htaccess is happy
        Require all granted
    </Directory>