Combing a symlink to an external folder with a Rewrite Rule?

Posted by Tristan on Stack Overflow See other posts from Stack Overflow or by Tristan
Published on 2009-08-28T04:27:12Z Indexed on 2010/04/08 3:03 UTC
Read the original article Hit count: 208

Filed under:
|
|

I've created a symlink in an account to an folder external to that user account (although with the same ownership). The symlink works but I'd like to combine it with a RewriteRule, and I'm having problems with that.

For instance I create the symlink with:

ln -s /home/target shortcut

And I add the following RewriteRule to .htaccess:

RewriteRule ^shortcut/([a-zA-Z0-9_-]+) shortcut/index.php?var=$1

This however fails.

Yet if instead of being located in an external folder, the target folder is in the same folder as the shortcut address, then the RewriteRule will work. i.e. it works if the symlink is:

ln -s ./target shortcut

How might I get the RewriteRule working for the case where the target folder is an external folder?

© Stack Overflow or respective owner

Related posts about symlink

Related posts about rewriterule