9
我想在我的.htaccess文件中创建的结构如下:有没有办法在Apache htaccess中重写if/else?
If (SITE A DOMAIN or SITE A SUBDOMAIN) {
Rewrite this specific way -> /index.php/$1
} else {
Rewrite this specific way -> /directory/www/index.php/$1
}
下面我有我当前的代码,但它抛出500S与我的Apache错误日志抱怨:
[错误] [客户端:: 1] mod_rewrite:达到的内部重定向的最大数量。假设配置错误。如果需要,使用'RewriteOptions MaxRedirects'来增加限制。引用:
我在做什么错?谢谢!
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|blog)
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$ [NC,OR]
RewriteCond %{HTTP_HOST}^example\.com$
RewriteRule .? - [S=1]
RewriteRule ^(.*)$ /directory/www/index.php/$1 [L]
RewriteRule .? - [S=1]
RewriteRule ^(.*)$ /index.php/$1 [L]
谢谢,工作! – 2012-08-10 20:32:29