ambiguousmouse
ambiguousmouse

Reputation: 2063

Apache symlink to a folder outside of web root

Here is the folder layout.

/outside is not normally accessible anywhere on example.com

/public_html is the folder for http://example.com

How can I use Apache's htaccess to make the url http://example.com/outside/ to show content from the folder /outside?

Thanks!

Upvotes: 2

Views: 5367

Answers (1)

Pekka
Pekka

Reputation: 449823

How can I use Apache's htaccess to make the url http://example.com/outside/ to show content from the folder /outside?

You can't. As far as I have found out, Apache prevents directives in .htaccess files linking to locations outside the current web root.

You would have to do this in the central configuration:

Alias /outside /path/to/your/outside

You may be luckier with a symlink if you can turn FollowSymLinks on.

Upvotes: 2

Related Questions