简单的重定向Apache的无限循环 [英] Simple redirect apache infinite loop

查看:149
本文介绍了简单的重定向Apache的无限循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我'用下,我在%XAMPP_ROOT%/ htdocs中放置.htaccess中的Windows 7的XAMPP。的.htaccess包含如下因素行:

I'am using xampp under the windows 7. I've placed .htaccess in the %XAMPP_ROOT%/htdocs. .htaccess contained the folowing line:

Redirect / http://localhost/test.php/

打字 HTTP后://本地主机到浏览器的地址栏中我有一个infinte回路误差为 <$c$c>http://localhost/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/.但我预计我重定向到的http://localhost/test.php/

After the typing http://localhost into the browser's address field I've an infinte loop error to a http://localhost/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/test.php/. But I'm expected that I'm redirected to http://localhost/test.php/.

推荐答案

您应该使用 RedirectMatch 为避免这种情况下使用正则表达式:

You should use RedirectMatch for avoiding this scenario using regex:

RedirectMatch ^/?$ http://localhost/test.php/

这篇关于简单的重定向Apache的无限循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆