403 Forbidden Issue

  • | 884 points

    I modified my 'C:\laragon\www\profitdigv2\public.htaccess' file and also my 'C:\laragon\etc\apache2\sites-enabled\xxxx.test.conf' file. The changes I made did not work--so I restored both of those files back to their original form, removing any changes that I had made. Now every time I try to access 'profitdigv2.test/login' URL, I get a 403 error, as shown here:

    (picture) https://ibb.co/hmPeLp

    Title: "403 Forbidden"
    URL: "http://profitdigv2.test/C:/laragon/www/profitdigv2/public/"
    Error Code: "FORBIDDEN You don't have permission to access /C:/laragon/www/profitdigv2/public/ on this server."

    So I guess my question is...are there other files I need to modify beyond just the .conf and .htaccess files that I modified with to get this working again?

    I tried manually changing the existing .conf and .htaccess files to match the text found in a "fresh laravel application". I used Laragon to create a Quick App --> Laravel and then grabbed the text inside .htaccess and .conf, then pasted that text into the profitdigv2 versions of those files. Then I modified the 'default' text to be specific to this particular project. Here are the contents of the files:



    Also I tried editing the permissions on the public folder (using windows permissions), and that had no impact. I compared the permissions to a fresh installed app, and everything seemed identical. Then as a hail mary, I went into terminal and changed the permissions using chmod--which also had no effect on the outcome.

    Any thoughts on what else I can do differently? Thanks.

  • | 884 points

    Just an update, it turns out that I CAN reach the login page by accessing:


    ...looking into why happened now. Will keep updated if a solution is found.

  • administrators
    | 131393 points

    Hi @Jeff-Givens

    I guess the root cause is your .htaccess setting not the file permissions.
    By the way, why did you access this url:

    Normally, you just access: http://profitdigv2.test which will serve code in C:/laragon/www/profitdigv2/public/

  • | 884 points

    Hi @leokhoa,

    I did not access "http://profitdigv2.test/C:/laragon/www/profitdigv2/public/" directly. This is the URL that gets entered into my browser when I type "profitdigv2.test/login" ...it automatically replaces the URL with the one that includes the C:\ directory.

    I do not fully understand how .htaccess works, so it appears I've done some damage somehow. I tried "returning to its original state" but fear that has not worked out very well.

  • administrators
    | 131393 points

    @Jeff-Givens : Did you try comment these lines:

    # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]

  • | 884 points

    @leokhoa I tried commenting the lines, then I reloaded apache. I experienced the same result. EDIT FOR CLARIFICATION Commenting those lines had no impact.

  • administrators
    | 131393 points

    @Jeff-Givens : Do you have a github access to your project?

  • | 884 points

    @leokhoa No, unfortunately it is a private repository. I would be happy to screenshare, though, with something like Teamviewer.

  • | 884 points

    @leokhoa I cloned the repository into another folder. The repository did not have the .htaccess or .env files in them (due to gitignore). But I copied them over from the 'broken' project. The cloned repository works just fine.

    What files could I have modified in the broken folder? The only 2 files that I changed was the public/.htaccess and the auto.profitdigv2.test.conf files earlier. Did this do something to other files in addition to the 2 that I modified?

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.