0
我有Opencart安装了SEO Url,我已经改变了一些页面的结构,并且想为301页面改变页面的重定向,所以没有(外部)链接将会中断。然而,我有SEO的链接活跃在opencart,这意味着一些重写规则被激活,我想这些干扰我的301重定向代码。为什么我的301重定向使用.htaccess文件无法正常工作?
最后一行是我的重定向。它不会将http://keroproducts.ch/kaufen
重定向到http://keroproducts.ch/produkte/
,而会重定向到:http://keroproducts.ch/produkte/?_route_=kaufen
,这是不正确的。
这是我的.htaccess文件:
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
# 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/
RewriteCond %{HTTP_HOST} ^www\.keroproducts\.ch [NC]
RewriteRule ^(.*)$ http://keroproducts.ch/$1 [L,R=301]
RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /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]
Redirect 301 /kaufen http://keroproducts.ch/
您试图在开启RewriteEngine之前重写。 – 2014-10-02 14:09:47
我已修复该问题。但问题仍然存在,请参阅更新的代码。 – kristian 2014-10-02 14:12:32