gpt4 book ai didi

.htaccess - 301 重定向页面不工作 opencart

转载 作者:行者123 更新时间:2023-12-04 17:21:36 27 4
gpt4 key购买 nike

部分页面指向opencart首页

例如:https://mywebsitenamehere.com/index.php?route=product/manufacturer

301重定向到:https://mywebsitenamehere.com/

我通常会添加这样的内容:

Redirect 301 /index.php?route=product/manufacturer https://mywebsitenamehere.com/

我的 .htaccess 片段:

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

谢谢!!

最佳答案

能否请您尝试使用显示的示例进行跟踪、编写和测试。请确保在测试您的 URL 之前清除浏览器缓存。

RewriteEngine ON
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]

RewriteCond %{QUERY_STRING} ^route=product/manufacturer [NC]
RewriteRule ^index\.php https://mywebsitenamehere.com [R=301,NC,L]

关于.htaccess - 301 重定向页面不工作 opencart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65844897/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com