apache - how to config .htaccess to prevent www.parent.com/child access www.child.com -
i have unix shared hosting have: / .htaccess a.html .... child/ .htaccess b.html ...... the www.parent.com points / www.child.com points /child i have prevent access www.parent.com/child without stopping www.child.com working. result can redirect, 404 or access denied. .htaccess files based on html5boilerplate .htaccess file. i tried modified /.htaccess without success: attempt #1: <directory /child> order deny,allow deny </directory> --> child.com stopped working. attempt #2: rewritecond %{http_host} ^.*parent.com.*$ [nc] rewriterule ^.*/child.*$ / [nc] --> nothing happens. tried different regex combinations. attempt #3: <ifmodule mod_rewrite.c> rewritecond %{request_uri} ^.*child.*$ [nc] rewriterule ^ / [r=302.l] </ifmodule> --> nothing happens. known 1 brute force, after trying main less aggressive options. i known rewriteengine on, because works: ...