我想在我的lcalhost中重定向url,因为当用户输入:mystring.localhost/CI
到localhost/CI/Mycontroller/Myaction/mystring
in codeigniter。现在显示Server not found并且表示浏览器Firefox无法在www.mystring.localhost
找到服务器。这个怎么做 ?提前致谢。我有这个在我的.htaccess
:在codeigniter中重定向Url
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mystring\.localhost\CI\
RewriteRule ^(.*)$ http://localhost/CI/Mycontroller/myaction/mystring/$1 [R=301]
你试过了。 – 2013-05-06 13:01:13
我在.htaccess中有这个:RewriteEngine On RewriteCond%{HTTP_HOST}^string \ .localhost \ Tests \ RewriteRule ^(。*)$ http:// localhost/Tests/string/$ 1 [R = 301],但它似乎不工作。 – Crazyrubixfan 2013-05-06 13:05:38
不幸的是,这是不是在localhost工作,所以我尝试在一个托管的网站,但它似乎也不工作 – Crazyrubixfan 2013-05-06 14:24:00