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).

link|improve this question
feedback

1 Answer

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.

link|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 – malfaux Oct 13 '10 at 10:12
feedback

Your Answer

 
or
required, but never shown

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