Virtuemart SEF:如何将 mod_rewrite 301 从 router.php 重定向到 Yagendoo 路由器

发布于 2024-12-22 12:54:18 字数 529 浏览 5 评论 0原文

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

router.php url

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

Yagendoo router url

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

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

预先感谢您的任何帮助。

I'm migrating an existing ecommerce site (Joomla 1.5 + Virtuemart) from basic router.php SEF to Yagendoo router plugin (Virtuemart SEO SEF Links Pro). The problem is, the two create different URLs and I don't want to lose current listings, so I thought of creating a mod_rewrite 301 rule.

router.php url

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

Yagendoo router url

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

I've come up with: RewriteRule ^it/home/category/(.*)$ it/$ [R=301,L] which is almost correct, but still gives me the category number before the name. Does anyone know how I can remove the number but still keep whatever comes afterwards?

Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一人独醉 2024-12-29 12:54:18

尝试这样的事情。

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

我没有检查它,但它是很容易根据您的目的对其进行定制。主要思想是将 和 存储在不同的变量中($1,$2)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文