从OpenCart删除的index.php?路径= [英] Remove index.php?route= from OpenCart

查看:840
本文介绍了从OpenCart删除的index.php?路径=的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个.NET开发者,但我的朋友打电话给我的support.I取得与htaccess的一些变化,但我已损坏的搜索引擎优化。

一切都开始用www的标签贴在url.I看到我们得到了一些错误,当我们没有使用www的,我改变了.htaccess.I'm添加重写规则和重定向mysite.com到www.mysite .com.Our问题都解决了,但现在我们有一个问题。

我们正在使用Opencart - 搜索引擎优化和它的enabled.Our的产品看起来像

  http://www.mysite.com/epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html
 

当我们到达以www。

但是,如果我删除的网址www的标签,好像

<$p$p><$c$c>http://www.mysite.com/index.php?_route_=epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html

和它腐败的搜索引擎优化。

我希望看到第二个URL像第一个。

我试着玩seo_url.php,但的.htaccess不改变点儿。

我也试过在<解决方案href="http://stackoverflow.com/questions/10813809/remove-index-phproute-common-home-from-opencart">Remove的index.php?路径=普通/回家OpenCart 但它不是为我工作。

现在我seo_url.php是默认的,我找回我的changes.And我的.htaccess是

 #搜索引擎优化的URL设置
RewriteEngine叙述上
#如果您opencart安装不上主Web文件夹中运行,确保你的文件夹它在IE浏览器中运行。 /变/店/

的RewriteBase /
重写规则^ sitemap.xml的$的index.php?路径=进/ google_sitemap [L]
重写规则^ googlebase.xml $的index.php?路径=进/ google_base [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
的RewriteCond%{REQUEST_URI} * \!。(ICO | GIF | JPG | JPEG | PNG | JS | CSS)
重写规则^([^] *)的index.php?_route _ = $ 1 [L,QSA]
的RewriteCond%{QUERY_STRING} ^路线=普通/家庭$
重写规则^指数\的.php $ http://www.mysite.com? [R = 301,L]
的RewriteCond%{HTTP_HOST}!^ WWW \ .mysite \ .COM $
重写规则(。*)http://www.mysite.com/$1 [R = 301,L]

重写规则^(。*)$的index.php?_route _ = $ 1 [L]
 

请帮我之前,我crazy.I花3个小时了。

感谢你们的一切, 问候

解决方案

试一试它使用的.htaccess为我工作。

?<?pre> 的RewriteCond%{THE_REQUEST} \ /index\.php \ _路线_ =([^&放大器; \] *) 重写规则^ /%1? [L,R]

I'm a .NET developer but my friend called me for support.I made some changes with .htaccess but i'm corrupted SEO.

Everything started with "www" tag on url.I see we get some errors when we are not using "www" and i'm changed .htaccess.I'm added rewrite rule and redirected mysite.com to www.mysite.com.Our problems are solved but now we have another problem.

We are using Opencart - SEO and it's enabled.Our products seems like

http://www.mysite.com/epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html

when we are reaching with www.

But if i remove "www" tag on url, it seems like

http://www.mysite.com/index.php?_route_=epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html

and it corrupt SEO.

I want to see second url like first one.

I'm tried play with seo_url.php , .htaccess but it doesn't change anyting.

I'm also tried solution on Remove index.php?route=common/home from OpenCart but it's not worked for me.

Now my seo_url.php is default, i get back my changes.And my .htaccess is

# 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/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://www.mysite.com? [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L] 

RewriteRule ^(.*)$ index.php?_route_=$1 [L]

Please help me before i get crazy.I spend 3 hours for that.

Thank you for all, Greetings

解决方案

Try This Its working for me using .htaccess.

RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
RewriteRule ^ /%1? [L,R]

这篇关于从OpenCart删除的index.php?路径=的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆