A test installation of drupal in a user directory of my OS X at first suffered from a wrong magic_quotes_gpc setting.

I attempted to resolve this by allowing the .htaccess file to override the basic settings but this had the effect of preventing access to Drupal.

Further inspection revealed that all access to the directory was barred

A not quick enough inspection of my error log at /var/log/httpd/error_log revealed that access was being prevented because Apache was attempting to rewrite the url which involved following a symlink which was not switched on by the .htaccess setting provided by Drupal.

Solution: add "FollowSymLinks" to the Options line which by default only has "-Indexes". ie use somethings like:

Options FollowSymLinks -Indexes

I post this because I noticed a number of unresolved questions on this matter and because Drupal seems really easy to set up in general and lots of peole in hosted situations may have similar problems. It is going great so far -- thanks guys.

Comments

taffy-1’s picture

Please put this in the FAQ. This was the missing piece of info for me!.

Cheers!

ax’s picture

i'd like to thoroughly understand this. why is FollowSymLinks required in the drupal dir? which symlinks should be allowed to follow? there aren't any in a default drupal install ... please clarify.

taffy-1’s picture

The site I'm working on is on a hosted site and to support multiple web sites, and users, symbolic links are used. So for Apache to resolve a web address to a page in my web site it has to traverse several symbolic links.

To make matters worse I installed into one directory and then created a symbolic link to it from under my website directory ... sort of made sense at the time.

ax’s picture

you don't need to add FollowSymLinks to the .htaccess in the drupal dir, but to the .htaccess of the dir that symlinks to drupal or to httpd.conf, right? if this is so, the FAQ entry you posted is wrong / doesn't make sense / should be reformulated.

Anonymous’s picture

I got the error described at the start. After putting in the FollowSymLInks in the .htaccess in my drupal directory the error went away.

Your millage may vary.

publogger’s picture

Hi,
seeing that the Options FollowSymLinks line is now per default in the .htaccess I just want to point out that this may cause problems.

I'm just starting with a drupal site in a shared hosting environment.
I wrestled with the Clean Urls feature for hours, only to find out that completely removing/outcommenting the Options line solved the problem.

BTW: I solved the magic quotes problem by adding an edited copy of php.ini to the directory where drupal lives. Got a copy of the default file with
< ?php
header("Content-type: text/plain");
readfile("/usr/local/lib/php.ini");
? >

Might be an option for folks who can't make use of the htaccess solution.