1

I decided to ask about this issue, because I found this problem is a common problem for many Drupal designers.

It seems to be a common problem for many drupal designers to face with the Server Error 500 after moving their site to the production server.

There are mainly two lines in the default .htaccess, which are:

# Don't show directory listings for URLs which map to a directory. 
Options -Indexes

# Follow symbolic links in this directory. 
Options +FollowSymLinks

So, for some hosts these lines should be removed.

What is your solution, after removing these lines from the .htaccess file? How should the directory listing be prevented?

4
  • I don't understand the 'These two lines according to newer version of Operating Systems or new Servers' config are prevented.' line so I don't understand the whole question.
    – sanzante
    Commented Nov 30, 2015 at 15:28
  • maybe that part was misleading. So the problem is that I have to remove the options lines from the .htaccess file. If I do it, how can I prevent the directory listing?
    – Ehsan
    Commented Nov 30, 2015 at 15:44
  • I'm sorry but this is not a Drupal related question, is about Apache .htaccess directives.
    – sanzante
    Commented Nov 30, 2015 at 16:05
  • 1
    @tunic this is a drupal related issue regarding default webserver configuration options assumed by Drupal core. See my post in this thread.
    – tenken
    Commented Nov 30, 2015 at 16:12

1 Answer 1

5

This is a known issue, see: https://www.drupal.org/node/1269780 regarding a longterm resolution.

In general it looks like going forward +FollowSymLinks should be replaced with +SymLinksIfOwnerMatch, but refer to the issue queue item above for a definitive answer.

Typically per host, and definitely with Shared Hosting plans it's up to your webhosts documentation as to what Apache Overrides are allowed by your (system) user account. There is a certain amount of trial and error is seeing if -Indexes for example is allowed on your webserver.

This is why when you upgrade Drupal they recommend backups of your projects .htaccess and robots.txt file as per webhost and project these files are highly likely to be modified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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