【发布时间】:2014-08-21 14:06:33
【问题描述】:
我在我的开发服务器上工作。
它没有域名,而是我过去通过 IP 地址访问它。我想制作重定向脚本
http://11.10.11.19/index.php to http://11.10.11.19/(给出的IP地址为示例)
.httaccess(开发服务器)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ 11\.10\.11\.19$ [R=301,L]
.httaccess(实时服务器)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ http://www.domainname.com [R=301,L]
当我尝试使用我的 live 站点 并且在 localhost 中它正在工作时,同样的事情。
【问题讨论】:
-
尝试使用
http前缀,例如http://11\.10\.11\.19$
标签: php regex .htaccess redirect