[英]modify URL using .htaccess
I want to change url for example http://www.mysite.com/cgshop/admin/index.php?route=common/home will become http://www.mysite.com/cgshop/cp/index.php?route=common/home . 我想更改网址,例如http://www.mysite.com/cgshop/admin/index.php?route=common/home会变成http://www.mysite.com/cgshop/cp/index.php? route = common / home 。 Please help me to figure out this.
请帮我弄清楚这一点。 Thanks in advance.
提前致谢。
This should get you what you want. 这应该给您您想要的。
It tests to see if the URI begins with /cgshop/admin/
and then captures the rest so it can redirect with a 301 to the new url. 它进行测试以查看URI是否以
/cgshop/admin/
开头,然后捕获其余部分,以便可以使用301重定向到新的url。 The QSA
means it will also carry over the query string (everything after the ?
). QSA
表示它还将QSA
查询字符串( ?
之后的所有内容)。
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/cgshop/admin/.*$
RewriteRule ^cgshop/admin/(.*)$ /cgshop/cp/$1 [R=301,L,QSA]
RewriteEngine On
RewriteRule ^cgshop/cp/.*$ cgshop/admin/$1
Try this....... 尝试这个.......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.