0

我正在将现有的电子商务网站(Joomla 1.5 + Virtuemart)从基本 router.php SEF 迁移到 Yagendoo 路由器插件(Virtuemart SEO SEF Links Pro)。问题是,两者创建不同的 URL,我不想丢失当前列表,所以我想创建一个 mod_rewrite 301 规则。

router.php 网址

http://hostname/it/home/category/<category ID>/<category name>

Yagendoo 路由器 url

http://hostname/it/<category name>

我想出了: RewriteRule ^it/home/category/(.*)$ it/$ [R=301,L] 这几乎是正确的,但仍然在名称之前给了我类别号。有谁知道我如何删除号码但仍然保留之后的任何内容?

提前感谢您的帮助。

4

1 回答 1

0

Try something like this.

RewriteRule ^it/home/category/([^/]+)/([^/]+)$ it/$2 [R=301,L]

I did not chek it, but it is pretty easy to customize it for your purposes. The main idea is storing and in different variables($1, $2).

于 2011-12-20T22:14:20.540 回答