I want to point multiple directory using the htaccess.
suppose i have two directory AAA and BBB.
if ( in url "AAA" is present ) point directory AAA; else Point director开发者_C百科y BBB.
Is it possible ??
Is this what you mean?
# make sure mod_rewrite is on
RewriteEngine On
# check request URI for AAA and rewrite to /AAA/ (only once)
RewriteCond %{REQUEST_URI} !^/AAA.*
RewriteRule (.*) /AAA/$1 [L]
# otherwise rewrite to /BBB/
RewriteRule (.*) /BBB/$1
Also, you might want to try:
RewriteCond %{REQUEST_URI} ^[^A]+AAA.*
instead of the first line, as I can't remember if they're a /
at the front of RewriteRule
s or not...
精彩评论