Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Options +FollowSymLinks -MultiViews within a .htaccess file that is stored within 1 folder above the images folders, but this causes issues for seeing the images in these directories when outputted onto the page via a URL. Once I remove this from the .htaccess, all images display fine.

Here is the entire .htaccess file as I have it:

Options +FollowSymLinks -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ http://%{HTTP_HOST}/ [R=301,L]

Is there something wrong with this? Cause the images are not being displayed at all when outputting them within an <img> tags src attribute.

Within the actual images directories, I have another .htaccess file that looks as follows:

<FilesMatch "\.(jpg|jpeg|png|gif|bmp)$">
  <IfModule mod_headers.c>
      Header unset Pragma
      FileETag None
      Header unset ETag
      Header set Cache-Control "max-age=864000, public, must-revalidate"
      Header unset Last-Modified
  </IfModule>
</FilesMatch>

Perhaps there is a better alternative for this that will allow me to see the images fine in the folders on my server? I'd like to know what was actually causing this to begin with to be honest.

Will removing this line cause any security risks? Options +FollowSymLinks -MultiViews Can I simply replace it with: Options -Indexes?

Basically, I still want the files within the folder to be accessible, but I don't want it so that when browsing to the URL of the folder, the files all get shown in there, if you know what I mean. Also, wondering, if this can be made so that it only accepts files from my server, and not any others? If that's possible or even makes sense...?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

When I hit problems like this the first thing I do is look at the actual HTTP response headers being returned.

The easiest way to do this is with curl command (http://curl.haxx.se/download.html):

curl -D headers.txt http://my_url.com

This will save the response headers to headers.txt, that should give you a much better idea of what is really going on. Hopefully that will be enough to point you towards a solution.

share|improve this answer
    
Thanks for your input, I have done this and seems fine now. –  Solomon Closson Sep 5 '12 at 8:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.