Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a protected folder in my server.


It also has a lot of subfolders with different services.


Now, i'd like to shorten the url of some services. I'd like to use symbolic links.

/var/www/service1 -> private/service1

Now the tests:

http://localhost/private/service1 <-- Asks for password, like i want.

http://localhost/service1 <-- Doesn't ask for password!!

Is this a general limitation of symbolic links or a misconfiguration issue? Tried on Fedora and Ubuntu with quite standard configs (i can post them at request).

share|improve this question

you probably enabled htaccess only for the target directory. you should also do the same for the symlink itself with:

<directory /var/www/symlink>
allowoverride all 

apache does not process the directives defined for the target directory after finding the symlink in the path. anyway, I would use an alias in apache config instead of symlinking. for shortening urls, that is.

share|improve this answer
I tried <Directory /var/www/service1>... and no joy. – LatinSuD Oct 13 '10 at 9:54
i apologize, i didn't pay attention to your directory structure. your htaccess is in private, not in private/service1 so a symlink from outside private to service1 will bypass the .htaccess rules. the only fix i see for this is using an alias instead of symlink – sysfault Oct 13 '10 at 10:12

Your Answer


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.