开发者

limit access to a web folder based on subdomain

I have a folder off my webroot that is linked to a subdoma开发者_运维知识库in. The folder can be accessed from either sub.domain.com or domain.com/sub ... I want to limit access ONLY to people accessing it from the subdomain. I'm currently doing this in php on the index page but I'm sure theres a better way. Advice?


I would have move that directory outside the domain.com folders. Then you point your sub.domain.com virtual host to this new directory.

Maybe you can also use the rewrite engine to redirect domain.com/sub on a error 403 Forbidden

RewriteRule ^sub/.*$ - [F]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜