WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] CSS/JS files and Admin result 404 on subsites (5 posts)

  1. majestixx
    Member
    Posted 1 year ago #

    I recently installed a new wordpress site (fresh install of wp 3.5) using the wordpress network feature.
    WP is installed in a folder ("blogs") and is configured to use subfolders for the subsites. e.g. http://auslandsjob.de/blogs/test/

    The site itself is showing up, but the included css & js files have an 404 e.g. http://auslandsjob.de/blogs/test/wp-includes/css/admin-bar.min.css?ver=3.5
    and the admin page has a redirection error: http://auslandsjob.de/blogs/test/wp-admin/

    I had a look at similar forum threads, but none of the solution applies to me: Sub-sites admin not accessible and CSS not visible after MU upgrade to 3.0, Upgrade to WordPress 3.0 Shows Broken Backend And No CSS Front Page For New Site, CSS/Admin Not Showing up in Sub "Sites"

    The generated .htaccess looks like this:

    RewriteEngine On
    RewriteBase /blogs/
    RewriteRule ^index\.php$ - [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).*) mnt/<localpath>/blogs/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ mnt/<localpath>/blogs/$2 [L]
    RewriteRule . index.php [L]

    It is placed in the 'blogs' folder.
    I have a second .htaccess in the root, but this does not seem to affect the behaviour. I tried the following combinations:
    I placed the WP .htaccess in the root (and deleted the other one) --> No change
    I deleted the .htaccess in the root (with the WP .htacces in the blogs folder) --> No change

    If I delete both css files I get a 404 on calling the subsite. Therefore it seems that the .htaccess is properly recognized and is working.

    Has someone any ideas? Or further things i could try?

  2. You need to see if AllowOverride is set to ALL (or Options All) in your httpd.conf

  3. majestixx
    Member
    Posted 1 year ago #

    Unfortunately is my hoster not even able to tell me which value is set for allowOverride.

    Are there any alternatives?
    I assume the not working rule is the third from the bottom. This does the redirect for any files in the WP directories.

    Do you have any idea why the subsite "test" is working at all? Doesn't that mean that the second rule from the bottom is working?

  4. Other than 'switch hosts'?

    No host should be unable to answer that question. The problem is that none of the advanced rules are working, and that's really quite silly for them not to be able to tell (unless they're saying 'We know, but we can't tell you' which is a whole different batch of silly).

  5. majestixx
    Member
    Posted 1 year ago #

    I agree :-)
    But finally I found a working solution! With just rewriting the .htaccess.

    For other users with the same issue. Here is my working .htaccess:

    RewriteEngine On
    RewriteBase /blogs/
    RewriteRule ^index\.php$ - [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).*)$ $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    I changed the RewriteRules from absolute to relative paths and now it works like a charm :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags