我搜索了论坛,但我被困住了。
我正在从Miva切换到Opencart,从动态网址转向seo友好。
我现在有这个:
RewriteCond %{QUERY_STRING} ^Screen=PROD&Store_Code=SI&Product_Code(.*)$ RewriteRule ^(.*)$ http://www.domain-name.com/catalog/ [R=301,L] RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=(.*)$ RewriteRule ^(.*)$ http://www.domain-name/catalog/ [R=301,L]它将我所有旧的谷歌链接发送到我的目录首页。 这是我猜的第一步。
Miva中的旧产品代码现在是Opencart中的型号,那么我在最后一条路径中调出模型代码又是什么呢? 我希望它看起来像Opencart中的搜索结果页面:
www.domain-name.com/catalog/786005
有人必须能够看到我在这里失踪的东西!!
I've searched the forums, but I'm stuck.
I am switching from Miva to Opencart and going from dynamic urls to seo friendly.
I have this right now:
RewriteCond %{QUERY_STRING} ^Screen=PROD&Store_Code=SI&Product_Code(.*)$ RewriteRule ^(.*)$ http://www.domain-name.com/catalog/ [R=301,L] RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=(.*)$ RewriteRule ^(.*)$ http://www.domain-name/catalog/ [R=301,L]It sends all my old google links to my catalog front page. It's a first step I guess.
The old product codes in Miva are now the Model numbers in Opencart so what the heck do I put in that last path to call out the model code? I want it to look like the search results page in Opencart:
www.domain-name.com/catalog/786005
Someone must be able to see what I'm missing here!!
最满意答案
您需要做的是使用您在重写条件中使用的查询字符串中的反向引用,使用您捕获的%1 。 你很亲密 您还可以将其合并为一条规则。
RewriteEngine On RewriteCond %{QUERY_STRING} Product_Code=(.*) RewriteRule ^(.*)$ http://www.domain-name.com/catalog/%1? [R=301,L]让我知道这对你有什么影响。
What you need to do is use the backreference from the query string that you used in the condition in the rewriterule using the %1 that you captured. You were close. You can also consolidate it down to one rule.
RewriteEngine On RewriteCond %{QUERY_STRING} Product_Code=(.*) RewriteRule ^(.*)$ http://www.domain-name.com/catalog/%1? [R=301,L]Let me know how that works out for you.
更多推荐
发布评论