开发者

How to rewrite query url to existing prettier url?

What is the syntax to rewrite this

http://www.example.com/cart/index.php?main_page=product_info&cPath=8&products_id=22

to this? http://www.example.com/class-registration

Note: RewriteBase has to be / because othe开发者_如何转开发r rules depend on it. It's a joomla 1.5 site. Please don't answer that I can use a component.

(repost from serverfault, realized mod rewrite q's don't get answered much there)


RewriteRule ^class-registration$ index.php?main_page=product_info&cPath=8&products_id=22


This is what you need to append to your .htaccess file to achieve the rewriting:

RewriteCond %{QUERY_STRING} ^main_page\=product_info\&cPath\=8\&products_id\=22$  [NC]
RewriteRule  cart/index.php  /class-registration?  [L,R=301,NE]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜