how can i avoid and allow subdirectories in htaccess
I want the following开发者_开发技巧 url
http://www.mydomain.com/user.php?id=username
to
http://www.mydomain.com/username
via .htaccess...
i also want to avoid subdirectory name conflict.... where i have a rewrite rule i.e
RewriteRule ^home/$ home.php?id=$1 [NC,L]
so my url become http://www.mydomain.com/home/ so i want this home to be ignored...in http://www.mydomain.com/username
Rewrite rules are evaluated in the order they appear. So just put your home rewrite rule first, and your username rewrite rule second, like this:
RewriteRule ^home/(.*)$ home.php?id=$1 [NC,L]
RewriteCond %{QUERY_STRING} ^id=(.*)$
RewriteRule ^user.php$ $1 [NC,L]
精彩评论