• I year ago I started this thread Images not working in subsites. It was closed so I am starting this thread to hopefully solve my issue. The issues with image uploads are still occurring, most of the info is the same as the old thread but I’ll include a little here.

    current root .htaccess

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$1 [L]
    # RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [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]
    
    #protection against script injections
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    RewriteRule ^(.*)$ index.php [F,L]
    
    #compress text,html,javascript,css,xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rcc+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    
    # Expires Headers - 2678400s = 31 days
    <ifmodule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 24 hours"
    ExpiresByType text/html "access plus 7200 seconds"
    ExpiresByType image/gif "access plus 2678400 seconds"
    ExpiresByType image/jpeg "access plus 2678400 seconds"
    ExpiresByType image/png "access plus 2678400 seconds"
    ExpiresByType image/ico "access plus 2678400 seconds"
    ExpiresByType text/css "access plus 1 second"
    ExpiresByType text/javascript "access plus 2678400 seconds"
    ExpiresByType application/x-javascript "access plus 2678400 seconds"
    </ifmodule>
    
    # Cache Headers
    <ifmodule mod_headers.c>
    
    # Cache specified files for 31 days
    <Filesmatch "\.(ico|flv|jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2678400, public"
    </Filesmatch>
    
    # NO CACHE for html/php files.
    <Filesmatch "\.(html|htm|php)$">
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    </Filesmatch>
    
    # Cache PDFs and CSS for a day
    <Filesmatch "\.(pdf|css)$">
    Header set Cache-Control "max-age=1, public"
    </Filesmatch>
    
    # Cache Javascripts for 31 days
    <Filesmatch "\.(js)$">
    Header set Cache-Control "max-age=2678400, private"
    </Filesmatch>
    </ifmodule>
    FileETag none

    Current /directory .htaccess

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

    I have two mutlisite installs running on this server the root http://www.rappahannock.edu and our directory http://www.rappahannock.edu/directory. Today I did an image upload test and turned on rewrite logging and these are the results.

    [Log moderated as per the Forum Rules. Please use the pastebin]

    Identical except for lines 7-8(indented). Does anybody have any idea what is going on here?

Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘URL rewrite issue with images in subsites redux’ is closed to new replies.