.htaccess opencart redirect 301

我只是将我的网站从asp迁移到opencart。在.htaccess中我想做一些重定向,以便我的客户可以使用旧的链接来访问 在里面.htaccess
redirect 301 /contact.asp http://www.example.com/index.php?route=information/contact_us
redirect 301 /downloads.asp http://www.example.com/downloads
但是,对于完美运行的联系我们,对于下载网址,它无法正常工作。 当我访问
http://www.example.com/downloads.asp
时,它将重定向到
http://www.example.com/downloads?_route_=downloads.asp
和Opencart显示它找不到页面。 对于
http://www.example.com/downloads
,我们在后端系统中设置了SEO友好URL。 我们能够访问 http://www.example.com/information/downloads http://www.example.com/downloads 但我们无法使用普通链接访问 http://www.example.com/index.php?route=information/downloads 以下是我的全部.htaccess
# Prevent Direct Access to files
<FilesMatch ".(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

redirect 301 /contact.asp http://www.example.com/index.php?route=information/contact_us
redirect 301 /downloads.asp http://www.example.com/downloads
============另一个测试======================== 我在我的localhost上做了一些测试我发现这是一个有趣的结果。但是,我的问题仍然没有解决。 我从http:// localhost / example和http:// example(添加的虚拟目录)运行.htaccess 对于http:// localhost / example
redirect 301 /example/downloads.asp http://localhost/example/downloads/
和 对于http:// example
redirect 301 /downloads.asp http://example/downloads/
然后我尝试从localhost重定向到我的实时版本链接(http:// example)
redirect 301 /downloads.asp http://www.example.com/downloads/
我访问http://example/downloads.asp 浏览器重定向到我 http://www.example.com/downloads?route=downloads.asp 风陵渡 在LIVE版本中,我没有添加任何重定向代码[非常可靠] 但在Live版本中,我将直接使用enter访问 http://www.example.com/downloads 我不知道为什么从localhost重定向301到现场版本会出来 http://www.example.com/downloads?route=downloads.asp 任何的想法?     
已邀请:
解决方案: .htaccess重定向301使用opencart v1.5.4.1 需要额外的代码...(和此修复的信用): https://github.com/opencart/opencart/pull/142 ...替换内容: - catalog / controller / common / seo_url.php - system / library / url.php 重定向精细: RewriteRule contacto http:.... com / index.php?route = information / contact [R = 301,L] 重定向不起作用: 重定向301 contacto http:.... com / index.php?route = information / contact 验证。     
把它放在路由器前面。在前面添加.asp和^之后的$。
# Prevent Direct Access to files
<FilesMatch ".(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On

redirect 301 ^contact.asp$ http://www.example.com/index.php?route=information/contact_us
redirect 301 ^downloads.asp$ http://www.example.com/downloads

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
为什么不将联系人重定向到
/information/contact_us
而不是
index.php?route=information/contact_us
?     
你可以尝试一下“?”在重定向url的末尾,如果它不存在,就像第二个url(它对我有用):
redirect 301 /contact.asp http://www.example.com/index.php?route=information/contact_us
redirect 301 /downloads.asp http://www.example.com/downloads?
    

要回复问题请先登录注册