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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -