Community Forums

how to SEO the index.php?route=common/home

General support for technical problems with OpenCart v1.x

Re: how to SEO the index.php?route=common/home

Postby Johnathan » Sun Oct 24, 2010 8:12 pm

.htaccess doesn't change the actual links, it just redirects as the link is being resolved.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2845
Joined: Thu Dec 17, 2009 7:08 pm

Re: how to SEO the index.php?route=common/home

Postby ifyouseek » Sat Oct 30, 2010 3:47 am

Code: Select all
    RewriteCond %{QUERY_STRING} ^route=common/home$
    RewriteRule ^index\.php$ http://www.yoursite.com? [R=301,L]


This code doesn't work if you want to accept multiple currencies or multiple lang's. Does anyone know a way around this.
ifyouseek
 
Posts: 158
Joined: Thu May 06, 2010 8:40 am

Re: how to SEO the index.php?route=common/home

Postby Johnathan » Sun Oct 31, 2010 5:35 pm

Alright, I worked for a while today on figuring out how to get around the currency/language switcher issue, and came up with the following solution:

Code: Select all
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.yoursite.com? [R=301,L]   

It's working fine for me so far -- let me know if you run into any problems.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2845
Joined: Thu Dec 17, 2009 7:08 pm

Re: how to SEO the index.php?route=common/home

Postby ifyouseek » Thu Nov 04, 2010 3:20 am

thanks, new code works fine so far
ifyouseek
 
Posts: 158
Joined: Thu May 06, 2010 8:40 am

Re: how to SEO the index.php?route=common/home

Postby Joxe » Sun Nov 07, 2010 4:43 pm

Hi,

Did not work for me.
My store has 2 languages and it's 1.4.7 :-\
v. 1.4.9.6 & v. 1.5.1.1
Joxe
 
Posts: 202
Joined: Tue Apr 27, 2010 10:12 pm

Re: how to SEO the index.php?route=common/home

Postby ocs » Sun Nov 07, 2010 6:28 pm

Johnathan wrote:Alright, I worked for a while today on figuring out how to get around the currency/language switcher issue, and came up with the following solution:

Code: Select all
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.yoursite.com? [R=301,L]   

It's working fine for me so far -- let me know if you run into any problems.


this is also work if Request Method using GET?
ocs
 
Posts: 34
Joined: Mon Oct 25, 2010 4:07 pm

Re: how to SEO the index.php?route=common/home

Postby Johnathan » Mon Nov 08, 2010 4:05 am

Yes, it should work when using GET. It only doesn't redirect on POST, because the language and currency switchers POST the variables to the same page.

Are you using GET on the homepage? What for?
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2845
Joined: Thu Dec 17, 2009 7:08 pm

Re: how to SEO the index.php?route=common/home

Postby alex.lin » Mon Nov 08, 2010 5:06 am

insert a keyword for common/home
like "INSERT INTO `url_alias` SET query = 'common/home',keyword = ''home"

it would be easier. :)
PHP,Java and rails Developer

My site.
- http://www.cnopencart.com opencart中文站
- http://www.tylsoft.net/Minimum-Order-Plus
- http://www.tylsoft.net/Banner-AD-Module

More modules at http://www.tylsoft.net, Tylsoft supply perfect module, template and custom service.
alex.lin
 
Posts: 107
Joined: Wed Jun 02, 2010 4:15 pm

Re: how to SEO the index.php?route=common/home

Postby ocs » Mon Nov 08, 2010 5:29 am

Johnathan wrote:Are you using GET on the homepage? What for?

No, I am not. I just want to know more...

then anyone know how to seo index.php?route= to /
but index.php?route=common/home also seo.

Many Thanks Johnathan
ocs
 
Posts: 34
Joined: Mon Oct 25, 2010 4:07 pm

Re: how to SEO the index.php?route=common/home

Postby TAC » Fri Nov 12, 2010 6:08 pm

Hi,

I am getting 404 Not Found errors on any page where I have put text in the "SEO Keyword:" box once I turn on the "Use SEO URL's:". I have been searching the forums for a solution but I am getting more confused the more I read.

So far I have done/checked the following:
I have the file named .htaccess not htaccess.txt
I have added (and then removed) bits of code I've found in other posts but I can't go too far with changes because I'm worried about messing everything up. I made a copy of the .htaccess file before I started.
I am using Apache on a Wamp and the rewrite_module is enabled
I am using one language & currency only
I have read the Trouble shooting entry about this problem and think my site is not in a subdomain - as I am using a Wamp my site is http://localhost/

UPDATE 27.11.I0 - I have since moved my site to the host server in a sub domain and done as Xsecrets said above
if your store is in a folder like shop or store you will need to edit the line RewriteBase / to be RewriteBase /shop/

and it works fine now. :)
Last edited by TAC on Sat Nov 27, 2010 3:30 pm, edited 1 time in total.
User avatar
TAC
 
Posts: 192
Joined: Sat Sep 25, 2010 5:33 pm

Re: how to SEO the index.php?route=common/home

Postby MrKing » Sun Nov 21, 2010 7:35 pm

Code: Select all
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.yoursite.com? [R=301,L]   


seems ok here with multiple currencies

Thank you
MrKing
 
Posts: 12
Joined: Tue Nov 09, 2010 1:00 pm
Location: UK

Re: how to SEO the index.php?route=common/home

Postby Johnathan » Sun Nov 21, 2010 8:47 pm

alex.lin wrote:insert a keyword for common/home
like "INSERT INTO `url_alias` SET query = 'common/home',keyword = ''home"

it would be easier. :)

This doesn't work because the seo_url.php files only take into account products and categories. Hence the .htaccess solution.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2845
Joined: Thu Dec 17, 2009 7:08 pm

Re: how to SEO the index.php?route=common/home

Postby jcgadgets » Thu Jan 13, 2011 1:42 pm

Hi,

I'm sure this is a dumb question, but exactly which .htaccess would I want to put this code into? I've got my shop in a folder of the root domain. There is of course an .htaccess in the root domain, in public_html, in the www folder, in my store's folder, etc...


Thanks!
Jared
jcgadgets
 
Posts: 115
Joined: Sun Oct 31, 2010 8:49 am

Re: how to SEO the index.php?route=common/home

Postby JAY6390 » Thu Jan 13, 2011 1:49 pm

In the same one as your config.php file is in
ImageImageImage

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4632
Joined: Wed May 26, 2010 3:47 pm
Location: United Kingdom

Re: how to SEO the index.php?route=common/home

Postby jcgadgets » Thu Jan 13, 2011 2:54 pm

Hey thanks.

And it really doesn't matter where I paste the code in that file?


Thank you,
Jared
jcgadgets
 
Posts: 115
Joined: Sun Oct 31, 2010 8:49 am

Re: how to SEO the index.php?route=common/home

Postby jcgadgets » Thu Jan 13, 2011 3:30 pm

Ok, got that part all figured out - which is GREAT, as Google will no longer be seeing all of those URL's as leading to duplicate content, title tags, description tags, etc...

However - now I'd like to make sure that every product has the proper breadcrumb path and proper URL category path. For example, I've got an iPhone as a featured item, in an all products category, and of course in the iPhone category. I only want the URL to read store/iphones/iphone4, and never store/all-electronics/iphone4 (all products link result) or store/iphone4 (featured link result).

I want to replace / redirect all the following (or at least the last two):
/StoreFront/All-Electronics/Factory-Unlocked-Apple-iPhone-4-32GB (result of the all products category)
/StoreFront/Factory-Unlocked-Apple-iPhone-4-32GB?manufacturer_id=8 (result of selecting the manufacturer link)
/StoreFront/Factory-Unlocked-Apple-iPhone-4-32GB (result of selecting via the "Featured" link)

to:
/StoreFront/Factory-Unlocked-iPhones/Factory-Unlocked-Apple-iPhone-4-32GB.


Any ideas? What do I need to replace QUERY_STRING with?


Thank you again!
Jared
jcgadgets
 
Posts: 115
Joined: Sun Oct 31, 2010 8:49 am

Re: how to SEO the index.php?route=common/home

Postby ivanssss » Fri Jan 14, 2011 11:23 am

eatblueorange wrote:im new to editing the .htaccess...anyone there know how apply these in the htacess file so that it could read as
http://www.yourshop.com/index.html and not with index.php?route=common/home?

and also is it possible to automatically SEO the product pages in the .htacess because the store owner sometimes dont bother to fill up the SEO url field when adding a product,

I want a url like this http://www.yourstore.com/index.php?rout ... duct_id=56
to automatically be http://www.yourstore.com/product-electronics-56
using the using code techniques in .htaccess? any brillant .htaccess guru there?


as the easy ways look here http://www.opencart.com/index.php?route ... earch=auto seo&sort=e.date_modified&order=DESC

changes http://www.yourstore.com/index.php?rout ... duct_id=56
to automatically be http://www.yourstore.com/product-electronics-56
ivanssss
 
Posts: 19
Joined: Wed Sep 29, 2010 5:54 am

Re: how to SEO the index.php?route=common/home

Postby drazen » Sat Mar 19, 2011 11:00 am

Hello,

thanks for code.
I have changed my .htaccess file as suggested and everything works fine in Firefox, and Google Chrome.
But IE8 doesn't want to show home page.

Did I do something wrong, or someone else experienced similar issue.

p.s. sorry for typos
drazen
 
Posts: 17
Joined: Sat Mar 19, 2011 10:55 am

Re: how to SEO the index.php?route=common/home

Postby peteoc » Wed Jul 06, 2011 11:24 am

just to add on to what people have said, a quick and simple fix for this is to edit the header.tpl file for your theme.

Locate the following line, it's line 50 in the default theme
Code: Select all
<div id="logo"><a href="<?php echo $home; ?>">


change it to

Code: Select all
<div id="logo"><a href="<?php echo "/"; ?>">


Obviously if you're working in a sub directory such as domain.com/store then it will be

Code: Select all
<div id="logo"><a href="<?php echo "/store"; ?>">
peteoc
 
Posts: 4
Joined: Sat Jun 25, 2011 10:48 am

Re: how to SEO the index.php?route=common/home

Postby cyjambo » Mon Jul 11, 2011 2:38 pm

Johnathan wrote:Alright, I worked for a while today on figuring out how to get around the currency/language switcher issue, and came up with the following solution:

Code: Select all
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.yoursite.com? [R=301,L]   

It's working fine for me so far -- let me know if you run into any problems.


Cool, thx a lot man! This seem to have worked.

Does anyone happen to know how to change things so they are a bit nicer (I have searched and read suggestions but nothing that works perfectly so far):

I have 3 languages on my site, and would like to do:
http://www.mysite.com/en/product/apple for english,
http://www.mysite.com/de/produkt/apfel for german and
http://www.mysite.com/hu/termek/alma for hungarian.

Is this somehow possible? I know it's quite easy with other cms but i couldn't find out how to do this yet.

Any help would be appreciated!
cyjambo
 
Posts: 4
Joined: Mon Jul 11, 2011 2:33 pm

PreviousNext

Return to General Support

Who is online

Users browsing this forum: MarketInSG and 62 guests

Hosted by Arvixe Web Hosting