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

I have a protected folder in my server.

/var/www/private/
/var/www/private/.htaccess

It also has a lot of subfolders with different services.

/var/www/private/service1/
/var/www/private/service2/
/var/www/private/service3/

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

1 Answer 1

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 
</directory>

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
1  
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

 
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.