You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by MIZiper <mi...@163.com> on 2012/11/01 13:55:40 UTC
[users@httpd] .htaccess in subdir affects
Hi there,
Assuming that the documentroot is ROOT and the domain is example.com.
ROOT's hierarchy is:
ROOT/handle/
ROOT/handle/handle.php
ROOT/dir1/
ROOT/dir1/.htaccess
ROOT/dir1/some1.txt
ROOT/dir2/
ROOT/dir2/some2.txt
ROOT/.htaccess
.htaccess in ROOT contains:
DirectorySlash Off
RewriteEngine On
RewriteRule (.*) /handle/handle.php?arg=$1
.htaccess in dir1 contains:
RewriteEngine On
handle.php:
<?php
print_r($_GET);
?>
example.com/dir1 will lead to a forbidden page
example.com/dir1/some1.txt will display the contents of some1.txt
example.com/dir2 will display: Array([arg]=>dir2)
example.com/dir2/some2.txt will display: Array([arg]=>dir2/some2.txt)
The last two results are what I want, so how to remove the effect of .htaccess in subdir?
(I'm using Apache httpd 2.2.20 on Windows)
THANKS,
MIZiper
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org