Link to home
Create AccountLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Why am I getting a 403 error?

I moved the Laravel site I was working on from one box to another. I can access the site just fine if I do http://localhost/new_nomas/public/index.php. However, if I try to configure my httpd-vhosts.config file to accommodate a "" url, as I did on the other computer, I'm getting a "403 Forbidden" error.

I'm running Apache 2.4.41. Here's my httpd-vhosts.config file:

<VirtualHost *:80>
	DocumentRoot c:/wamp/www/new_nomas/public
	<Directory "c:/wamp/www/new_nomas/public">
	AllowOverride All
    Require all granted

Open in new window

...and here's my "hosts" file from the Windows/System32/drivers/etc directory:

Everything is pretty much identical to what I had before, but when I attempt "" in my URL, I get a "403 Forbidden" message.

I've adjusted the security permissions in all of the files...

What am I missing?
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

It could be down to your .htaccess file  - specifically the rewrite section. Have your tried to call your index.php page file directly:
Avatar of Bruce Gust


Hey, Chris!

When I try, I get the same error.
Double check your httpd.conf file's include directive whether the vhost file has to gave vhost-file.conf versus vhost-file.config

I think the vhost that includes your definition is not being included.
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Alright, guys...

First of all, Laravel seemingly keeps it error logs in storage/logs and the last error was 12/15/2019, so there's either no error being generated or something's wrong with the permissions. If there's a problem with the permissions, I can't tell.

I've changed the .htaccess file to no avail.

Whatever it is, it's one obstinate anomaly. I can't make this thing budge.

Any other suggestions?

BTW: I tried initiating a brand new laravel project just to rule out any kind of weirdness with the copying and pasting of an already existing project. Same problem. I can't initiate a virtual server for anything.
I'm an idiot!

I found the apache_error.log file and it said that the directory that I was referencing didn't exist.


On my new box the root directory is wamp64 and not wamp.

Mystery solved!


Sorry it wasn't a more "technical" problem!
You're welcome!

Glad you got this solved!

Logs are your friends...