Opencart 301 重定向错误
我阅读了所有可用的问答,但我仍然没有找到任何解决方案。
我正在使用 wordpress 运行在线商店..现在由于支付网关选项,我转向 opencart。但我有 301 URL 重定向问题..
http://website.com/2011/01 /my-product-name/
到
http://website.com/my-product -name.html
我的htaccess 代码:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#### Rewrite Code ####
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
Redirect 301 ^/2011/01/my-product-name/$ http://website.com/my-product-name.html
当我尝试将其重定向到后,
http://website.com/my-product-name.html/?_route_=2011/01/my-product-name/
我不知道为什么它会添加 ?route= inurl 和所有其他链接?
有什么解决办法吗?
I read all availabe Q&A but i still did not found any solution.
I am running a Online store using wordpress.. now i move to opencart because of Payment Gateway option. but i have 301 URL redirect Problem..
http://website.com/2011/01/my-product-name/
to
http://website.com/my-product-name.html
My htaccess code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#### Rewrite Code ####
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
Redirect 301 ^/2011/01/my-product-name/$ http://website.com/my-product-name.html
After when i try to redirect its redirect to
http://website.com/my-product-name.html/?_route_=2011/01/my-product-name/
I don't know why its add ?route= inurl and all other other link?
is there any solution available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要为所有 2011 年产品设置这样的重定向规则,您可以使用
假设
(my-product-name) 作为每个产品的 URL 别名
当然,如果有些是文章,您实际上可以使用与产品相同的方法重写到与旧 WordPress 帖子内容相同的信息页面:他们是正确的网址别名
If you want a redirect rule for all of your 2011 products like that, you could use
Assuming that
(my-product-name) as the URL alias for each product
Of course, if some are articles, you could in fact rewrite to information pages with the same content as the old Wordpress posts using the same method as you have for products by giving them the correct url alias