• Hello everyone,

    I am currently running a multisite network with the subdirectory setup and I believe it has been set up successfully, however, I just installed a second site in the subdirectory and it is receiving a “403 – Forbidden You do not have permission to access this document’ error. The first site looks/appears fine.

    My network is set us as such:

    1st site: example.com
    2nd site: example.com/example

    The second site is the one receiving the error, however if you visit the second site as such: example.com/example/2013/08/16/hello-world/ it works fine, but nothing at example.com/example displays other than the 403 error, but it seems like posts that I have been imported appear, but nothing loads at the subdirectory leve (example.com/example).

    Also, I only have one htaccess file and it is located under site 1 (example.com), do I need to create one and add it to site 2 under example.com/example? FWIW, here is what is in my htaccess file for site 1:

    #Protect the .htaccess File
    <files .htaccess="">
    order allow,deny
    deny from all
    </files>
    
    # disable directory browsing
    Options All -Indexes
    
    <IfModule mod_deflate.c>
    <FilesMatch "\.(js|css|php|html|js^|css^)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
    
    # Force non-www
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.type\.is$ [NC]
    RewriteRule ^(.*)$ https://type.is/ [L,R=301]
    
    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    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]
    # END WordPress

    Any insight and help would be great. Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter qubed

    (@qubed)

    I have also contacted my hosting provider and they have responded with this:

    ‘I looked into your query. I found that your type.is/knowledge directory does not contain any data. I setup a test file in there to make sure that the server is working correctly (see: https://type.is/knowledge/test.txt), and can tell you that in order to make that sub-directory resolve, you will need to put an index file in it (index.html, index.php, index.htm, etc…) with either the page you want to resolve or a reference definition to the page that you want to resolve.

    If you have any other questions or need any more information regarding your (mt) Media Temple services, please feel free to contact us at any time.’

    My question is, what do I need to put in the index file so that my wordpress site for example.com/example would appear? Do I even need to put an index file there or do I put a reference definition to the page? If it is a reference definition, what is that and what do I put as I am not familiar with this.

    A couple of other things worth noting, I have deactivated the W3 Total Cache plugin and removed its lines from the htaccess file above. I have added the following to the htaccess file:

    Options +FollowSymLinks
    and
    DirectoryIndex index.html index.php

    I added these lines from reading other support resolutions from other users, but unfortunately, these haven’t resolved the problem. Thanks!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Your host is right, but wrong for Multisite. Tell them ‘example’ is a VIRTUAL folder (seriously, that a host doens’t understand that bothers me sometimes…) so no, it doesn’t exist.

    Have you tried trimming your .htaccess back to JUST the WP rules?

    Thread Starter qubed

    (@qubed)

    Thanks for the response Mika! I have tried trimming the htaccess back to just the WP rules and still no dice.

    I don’t understand how the sub-directory receives the 403 error, but all the content below the subdirectory displays.

    Any ideas, as I am perplexed how to get this sorted?

    Thread Starter qubed

    (@qubed)

    Slight update, I seem to have been able to get the subdirectory to resolve possibly.

    I have added the following to my htaccess:

    # Fix 403 errors on existing directories; WordPress overrides.
    RewriteCond %{REQUEST_URI} ^/(subdirectory)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /index.php [L]

    That’s the good news and even better news, I know that information will benefit many others in the future.

    The bad news is the subdirectory design layout and content now looks like 1996 html/css (https://imgur.com/2Ay7uj9) and I’m not sure how to proceed in remedying this. Is this an issue with my htaccess file now that is causing this or something else altogether I need to fix? Previously, when the 403 error was appearing for my subdirectory that’s all that was happening as the page/post content below the subdirectory was displaying properly, now it is all wonky and looking like a list from the 1990’s.

    In regards to the images being broken, I’d like to point out that my upload path for my primary site on the network is: wp-content/uploads and for my secondary (subdirectory) site, it’s: wp-content/blogs.dir/6/files

    Do one of these need to be changed to match the other? Also, probably in relation, it appears the image path is broken in my wp-admin as well for my Network Admin dashboard as the images from Ozh’s Drop down panel aren’t displaying either: https://i.imgur.com/1UUWu2q.png – Also FWIW, I have all plugins deactivated except for Askimet and Ozh’s Drop down menue

    Thanks in advance for any help!

    qubed

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *ponder* Ask your webhost this: “Is AllowOverride set to either ‘All’ or ‘Options All’ for my domain? Some of my more complex .htaccess rules aren’t being honored.”

    Thread Starter qubed

    (@qubed)

    I’ve just checked and AllowOverride is set to all, but the problem still persists. Any other suggestions?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Did you check, or did your HOST check?

    There’s more than one spot where AllowOverride is set, you see.

    I’ve seen this kind of malfunction on CSS stylesheets (not getting retrieved), while using SuperCache and W3 Total Cache before having everything set up right.

    My issue usually has been an error on .htaccess rules, as Ipstenu is asking for check. My dumbest error was not including the “RewriteBase /” directive. Sometimes has been a harder to spot, since even the slightest error on the directives can render 403-code, or even 500-errors.

    As Ipstenu has recommended previously, re-check your .htaccess rules and use only that provided by WP, I’d recommend disabling caching plugins too (and any other plugin for redirection or messing up with permalinks {some SEO plugins do that, in example}).

    Then, try to see if your blogs are usable (entering wp-admin, making a post, accessing the feeds, etc.), the enabling only a plugin/feature at once; I know this seems an awkward method looking like starting from scratch, but It’s not wise enabling every available optimization without checking everything is fine step by step.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I hadn’t even thought abotu caches… Flush ’em too!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘403 Forbidden Error’ is closed to new replies.