我有一个问题如何配置这个,测试网站工作正常,“http://test.domain/beta/”,但当我们配置域“http:// prod_domain /”,指向在同一目录上,它返回一个http 500错误,我检查了apache错误日志并得到了这个:
mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
这是我的.htaccess,如:
RewriteEngine On
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php?/$1 [L]
答案 0 :(得分:1)
您需要针对REQUEST_URI进行条件匹配,并在比赛前面添加斜杠:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php?/$1 [L]