• Resolved floyergilmour

    (@floyergilmour)


    Hey guys i have a problem with showing images in my subsites. when browsing around the web most problems seems to be linked with the .httacess file. i have 2 of those, one in “public_html” folder and one in the “inug.se” folder(my url but it won’t work if you try to go to https://www.inug.se because you will get to the old home page which works perfectly, im working on the new website).

    here’s the code for the .httacess file which is in this directory /home/inug/public_html/.htaccess

    # Google Analytics Integration - Added by cPanel.
    <IfModule mod_substitute.c>
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s|(<script src='/google_analytics_auto.js'></script>)?</head>|<script src='/google_analytics_auto.js'></script></head>|i"
    </IfModule>
    # END Google Analytics Integration
    
    # ultimate hotlink protection
    <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteCond %{HTTP_REFERER}     !^$
     RewriteCond %{REQUEST_FILENAME} -f
     RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$           [NC]
     RewriteCond %{HTTP_REFERER}     !^https?://([^.]+\.)?inug\. [NC]
     RewriteRule \.(gif|jpe?g?|png)$                             - [F,NC,L]
    </ifModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    and here is the code for the other httacess file in /home/inug/public_html/inug.se/.htaccess directory

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded ?les
    RewriteRule ^([_0-9a-zA-Z-]+/)??les/(.+) wp-includes/ms-?les.php??le=$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 tried to comment out
    RewriteRule \.(gif|jpe?g?|png)$ - [F,NC,L]

    but that didn’t seem to work

    very grateful for any help

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

    (@ipstenu)

    ?????? Advisor and Activist

    You shouldn’t have TWO .htaccess files.

    What’s the ‘home’ folder location of your domain? On cPanel it’s normally /home/username/public_html

    What you described (/home/inug/public_html/inug.se/) is normal for an add-on domain. Are you using an add-on?

    Thread Starter floyergilmour

    (@floyergilmour)

    Hi Ipstenu thanks for your response

    here is a screen shot for refernece
    https://dl.dropboxusercontent.com/u/399598/Screen%20shot%202013-08-01%20at%2009.37.51.png

    it is in /home/inug/public_html/inug.se folder

    I have https://www.inugbloggar.se in the same folder if that’s what you mean by add-on daomain

    i have however solved the problem by replacing the the second -httaccess file with the following code which is very similar

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    
    RewriteRule ^ - [L]
    #raden under lade jag till fr?n den f?rra .httacess filen, den fanns inte d?r innan, nu kan man d? se bilder i sub-sidor vilket man inte kunde innan
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule . index.php [L]
    
    </IfModule>
    # END WordPress

    Hi there,

    Your public_html is not where your WordPress files are, as shown in your screenshot, so the htaccess in that directory, the root directory, probably isn’t affecting anything. Looks like this is resolved, so please mark it as such.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘multisite not showing images for subsites’ is closed to new replies.