【发布时间】:2013-11-20 19:20:25
【问题描述】:
我正在尝试使用 .htaccess 重写我网站的 URL,这就是我想要的
目前,网址如下所示
http://www.mysite.biz/store/cart.php?m=new_arrivals
所有网站都是使用 php GET 加载的,唯一改变的是 cart.php 之后的查询字符串,所以我想重写为....
http://www.mysite.biz/cart.php?m=new_arrivals
我一直在互联网上进行搜索,并尝试了各种技术来做到这一点,但都没有奏效。这个我试过了...
RewriteRule ^store/(.*)$ http://www.mysite.biz/$1 [R=301,L]
这...
RewriteCond %{REQUEST_URI} ^/store($|/)
RewriteRule ^.*$ /store/cart.php [L]
还有这个……
RewriteCond $1 !^store
RewriteRule ^(.*) /store/$1 [L]
我已经开发网络一段时间了,但这是我第一次真正用 .htaccess 做任何事情,我完全被难住了。任何帮助将不胜感激
【问题讨论】:
标签: apache .htaccess mod-rewrite url-rewriting