.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
任何的想法?
没有找到相关结果
已邀请:
3 个回复
哭木算
盟犯涩沟都
为什么不将联系人重定向到
而不是
?
弓萍功