apache - Deny access to all content except content from one folder -
i want allow access 1 folder of site in given subdomain, , have subdomain pointing same documentroot full access. want avoid duplicated urls (for seo purposes).
in restricted virtualhost have configuration ...
<directory /var/www/secundary.mysite.com/web> options -includes +execcgi allowoverride rewriteengine on rewritecond %{query_string} !/bundles.*$ [nc] rewriterule ^.*$ - [f] </directory>
so expect navigation mysite.com give forbidden response, www.mysite.com/bundles/js/script.js returns normal response.
the result every request secundary.mysite.com returns normal response. missing something, or ...?
i have been using wrong variable. wrote %{query_string} instead %{request_uri} variable wanted match again regular expression. correct syntax purpose was:
<directory /var/www/secundary.mysite.com/web> options -includes +execcgi allowoverride rewriteengine on rewritecond %{request_uri} !^/bundles(.*)$ [nc] rewriterule ^.*$ - [f] </directory>
Comments
Post a Comment