Apache – WampServer – 403 Forbidden You don’t have permission to access / on this server.

Posted: October 14, 2011 in Apache, Drupal

You have a website and you deploy it on WampServer. The home page run Success, but when you click the content page (example: http://your-site.com/content/article-one.html) you will get an error 403 Forbidden you don’t have permission to access.

Solution for the error 403 Forbidden you don’t have permission to access / on this server.  All you need to resolve it is enable Rewrite Module on WampServer and config the Rewriter Role

Here are the step to config site

1. Enable Rewriter Module by select rewrite_module

Enable rewriter module

Enable rewriter module

2. Config WampServer

- Open httpd.conf file to enable Virtual Host (F:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf)

- Enable Virtual Host

+ Remove the “#” from the begging of the following line

#Include conf/extra/httpd-vhosts.conf

+ Open file F:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf to config virtual host

  • At line 15 add code
<Directory F:/WebRoot/your-site-com>
  Order Deny,Allow
  Allow from all
</Directory>
  • At the end of file add code
<VirtualHost *:80>
    ServerAdmin webmaster@your-site.com
    DocumentRoot F:/WebRoot/your-site-com
    ServerName your-site.com
    ServerAlias www.your-site.com
</VirtualHost>

3. Config Virtual Host to enable Rewrite URL

- Update the VirtualHost in F:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin webmaster@your-site.com
    DocumentRoot D:/Your-Site
    ServerName your-site.com
    ServerAlias www.your-site.com
	<Directory />
 Options FollowSymLinks
 AllowOverride All
 </Directory>
</VirtualHost>

Now, Restart the WampServer, you site now is support Rewriter URL

4. Resolving the DNS issue

Opend file C:\windows\system32\drivers\etc\hosts and add domain

127.0.0.1    your-site.com

DONE :)

About these ads
Comments
  1. faizan says:

    Please explain the reason for changing these conf.

    • Kenneth says:

      I’m testing this out now since I’m getting this message and can’t see my own site. Just one problem, how do I Enable Virtual Host?

  2. Jeepsey says:

    I had similar problems, I resolved the issue by changing “Listen 80″ to “Listen 127.0.0.1:80″ in httpd.conf.

  3. Virgil says:

    this worked for me. thanks.

  4. Thanks a lot. It saved my day.

  5. Evan M says:

    I could not navigate to any page, not even the WampServer home page. I skipped all these steps and have full access to that page and all subsequent just by navigating to “127.0.0.1″ instead of “localhost.” Will this lead to troubles for me down the line?

  6. Any security issues here ? i would rather only allow my localhost to my 127.0.0.1 ip ?? all of a sudden my wamp has started playing up and locking me out.. now i am stressing about security issues.. any advice is greatly appreciated

  7. mina says:

    please help me. it was installed. but when click to phpMyAdmin it will show “Forbidden

    You don’t have permission to access /phpmyadmin/ on this server.” how to settle up this problem??

  8. Jeff says:

    I am using this as a testing server. I did the steps involved, but I was confused about ‘F:/WebRoot/your-site-com’. Do you have to use “F”? Mine is on C:/wamp Also when you say to put 127.0.0.1 your-site.com is this necessary for a testing environment ( I don’t have a .com as it’s just testing environment now). Still no access to sub-directories in 127.0.0.1:8080 (I am using WAMP and IIS, so WAMP is on 8080). Why?

  9. Vidzone says:

    Thanks…. succesfully…. i only follow one step “rewrite_module”

  10. Dina says:

    It worked tnX :)

  11. TeLeScOpE says:

    If I Remove The # Sign To This Line #Include conf/extra/httpd-vhosts.conf My Apache Can’t Start

    But If I Back The # Sign My Apache Can Start

    How To Fix This Problem , Because I Want To Enable My VH..

    Any Solution? Please Reply.

    Windows xp sp3

    Wamp Server V.2.0i

  12. Howdy, i read your blog from time to time and i own
    a similar one and i was just wondering if you get a lot
    of spam remarks? If so how do you reduce it, any plugin
    or anything you can recommend? I get so much lately it’s driving me crazy so any support is very much appreciated.

  13. Do you mind if I quote a couple of your posts as
    long as I provide credit and sources back to your weblog?
    My blog is in the exact same area of interest as yours and
    my visitors would truly benefit from some of the information
    you provide here. Please let me know if this alright with you.
    Thank you!

  14. It’s actually a great and helpful piece of info. I am glad that you simply shared this helpful info with us. Please stay us up to date like this. Thank you for sharing.

  15. Lisa Lester says:

    I CAN’T SIGN ON TO FACEBOOK IT KEEPS TELLING ME FORBIDDEN ACCESS 403 AND THAT THERE IS A NON SECURE ITEM ON THAT PAGE it started last week Please hellp me Thanks

  16. You have made some decent points there. I checked on the internet for additional information
    about the issue and found most individuals will go along with your views on this web site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s