• I have been having this problem all week. I’ve gone through a lot of forum posts with similar issues, but none of the fixes have worked for me. This is a local site, with subdirectory setup instead of subdomain. My .htaccess file is as follows:

    RewriteEngine On
    RewriteBase /singlesite/
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1/wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) C:\xampp\htdocs\singlesite/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ C:\xampp\htdocs\singlesite/$2 [L]
    RewriteRule . index.php [L]

    and my DocumentRoot is as follow:

    <Directory />
    	Options FollowSymLinks
        AllowOverride All
    	Order deny,allow
    	Allow from all
    
    </Directory>

    The original landing page, https://localhost/singlesite, works fine. Adding a new site, say https://localhost/test, results in a new site without a theme (just text and links), and the dashboard, or wp-admin, leads to a Access Forbidden 403 page.

    I figured out that in the Apache error logs there was a “client denied by server configuration” with the following path:
    C:/xampp/htdocs/singlesite/test

    I realized that this path actually does not exist, so as a workaround I copied all files in the singlesite folder into the singlesite/test folder. This allows me to access the sites in full with themes and dashboard.

    Any help would be appreciated, all the experts here have done a great job.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Try this:

    <Directory />
    	Options FollowSymLinks
        AllowOverride Options All
    	Order deny,allow
    	Allow from all
    
    </Directory>
    Thread Starter paravorheim

    (@paravorheim)

    I tried replacing mine with yours, and I still get a 403 forbidden. when accessing dashboards of subdirectory sites, and a plain text and link page for the sub sites. do you need any other error logs, or files?

    Thread Starter paravorheim

    (@paravorheim)

    I just realized I may have added the <Directory /> in the wrong place… it does go in apache’s httpd.conf right?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yes. Is this localhost running xamp?

    Thread Starter paravorheim

    (@paravorheim)

    Yes, it is. I should have mentioned that, sorry.

    Thread Starter paravorheim

    (@paravorheim)

    Is there an unwritten rule (or written) that says not to use XAMPP? I have tried this using the bitnami installation as well, and received the same errors.

    I have exactly the same problem, any help?

    I just ran into this same issue running WAMP locally. The issue was with the htaccess rules provided by WordPress. WordPress told me to use this:

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) C:/wamp/www/brad-site/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ C:/wamp/www/brad-site/$2 [L]
    RewriteRule . index.php [L]

    When it should have been:

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    Updating these 6 lines in htaccess fixed the issue for me.

    I was able to get the proper htaccess rules from a different local Multisite network I have setup that was working fine. Hopefully this helps others.

    Thanks Williams. I was struggling to solve this issue and pulling my hairs and was going to throw the laptop out.

    wordpress must fixed this issue.

    Thanks a lot Williams! I am using WAMP and this new 6 line of code worked like a charm! Really appreciate it!

    tarlsieWP

    (@tarlsiewp)

    Thanks Brad,
    this solved my problem
    Daniel

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Adding site in subdirectory, Access Forbidden 403 when going to wp-admin’ is closed to new replies.