我想在我的 .htaccess 文件中创建以下结构:
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
}
我在下面有我当前的代码,但是我的 Apache 错误日志抱怨它抛出了 500 秒:
[错误] [客户端 ::1] mod_rewrite:达到内部重定向的最大数量。假设配置错误。如有必要,请使用“RewriteOptions MaxRedirects”来增加限制。,referer:
我究竟做错了什么?谢谢!
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]