httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MIZiper <mizi...@163.com>
Subject [users@httpd] .htaccess in subdir affects
Date Thu, 01 Nov 2012 12:55:40 GMT
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


Mime
View raw message