0
我需要实现以下重写规则为我的Magento 1号店不起作用。阿帕奇重写+ Magento的预期
下面是一个例子:
www.mystore.com/myfilter/ --> www.mystore.com/myfilter/
www.mystore.com/myfilter/?param1=1 --> www.mystore.com/myfilter/param1=1
www.mystore.com/<something>/?param1=1 --> www.mystore.com/<something>/
www.mystore.com/<something>/?param2=2 --> www.mystore.com/<something>/
我加在.htaccess如下:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/myfilter/?
RewriteCond %{QUERY_STRING} param1 [OR]
RewriteCond %{QUERY_STRING} param2
RewriteRule (.*) /$1? [R=301,L]
标准的Magento前重定向:
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
但它的工作方式不对。 这些网址的工作:
www.mystore.com/myfilter/ --> www.mystore.com/myfilter/
www.mystore.com/myfilter/?param3=1 --> www.mystore.com/myfilter/?param3=1
www.mystore.com/<something>/?param1=1 --> www.mystore.com/<something>/
www.mystore.com/<something>/?param2=2 --> www.mystore.com/<something>/
但是当URI包含/myfilter/
,要么param1
或param2
,它重定向我/index.php
:
www.mystore.com/myfilter/?param1=1 --> www.mystore.com/index.php
我错过了什么?
尝试后您的服务器的故障问题了。 –
@ M.Gara对于服务器故障,这不是**主题。看看服务器故障的[如何问](https://serverfault.com/help/how-to-ask)。 –
这不是服务器故障,我可以在不同的服务器上看到相同的行为,包括我的本地apache。这与Magento的重写和apache有关。 – Dmitry