Post by TAC » Sat Nov 13, 2010 2:08 am

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 11:30 pm, edited 1 time in total.

User avatar
TAC
Active Member

Posts

Joined
Sun Sep 26, 2010 1:33 am
Location - England

Post by Johnathan » Mon Nov 22, 2010 4:47 am

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 Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by jcgadgets » Thu Jan 13, 2011 9: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

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by JAY6390 » Thu Jan 13, 2011 9:49 pm

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

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by jcgadgets » Thu Jan 13, 2011 10:54 pm

Hey thanks.

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


Thank you,
Jared

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by jcgadgets » Thu Jan 13, 2011 11: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

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by ivanssss » Fri Jan 14, 2011 7:23 pm

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

Newbie

Posts

Joined
Wed Sep 29, 2010 1:54 pm

Post by drazen » Sat Mar 19, 2011 7:00 pm

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

Newbie

Posts

Joined
Sat Mar 19, 2011 6:55 pm

Post by peteoc » Wed Jul 06, 2011 7:24 pm

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"; ?>">

Newbie

Posts

Joined
Sat Jun 25, 2011 6:48 pm

Post by cyjambo » Mon Jul 11, 2011 10: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!

Newbie

Posts

Joined
Mon Jul 11, 2011 10:33 pm

Post by uksitebuilder » Tue Jul 12, 2011 12:39 am

Why not simply add it to the url_alias database table ?

In ours we have added this and also made many other pages SEO Friendly URLs

for home page:

INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Johnathan » Tue Jul 12, 2011 3:48 pm

uksitebuilder wrote:Why not simply add it to the url_alias database table ?

In ours we have added this and also made many other pages SEO Friendly URLs

for home page:

INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');
Because that doesn't work. The code that processes the SEO URLs only accounts for products, categories, manufacturers, and information pages. You must have modified your seo_url.php files that database addition works for you.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by uksitebuilder » Tue Jul 12, 2011 3:54 pm

Of course you are correct, I had a totally blank moment when I posted the above.

To solve, I have attached a rewritten catalog/controller/common/seo_url.php file

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by tonic » Tue Jul 12, 2011 6:25 pm

uksitebuilder wrote:Of course you are correct, I had a totally blank moment when I posted the above.

To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
seo_url.php
Yep, but in this file there is a line at the top of file:

Code: Select all

$this->url->addRewrite($this);
which is returns fatal error, because there are no this method in standart OC code. What this method do and this is mandatory for good working SEO URL rewriting?

If you may - can you put here the file with this method & class.
Thx.

Newbie

Posts

Joined
Tue Jul 12, 2011 6:22 pm

Post by uksitebuilder » Tue Jul 12, 2011 6:47 pm

It's in system/library/url.php (OC 1.5.x)

See my mods below for a mod that does all the site Friendly SEO

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by yest » Thu Aug 25, 2011 4:20 am

i replaced the file but there is no changed ... why ???

New member

Posts

Joined
Thu Aug 05, 2010 1:57 am

Post by dony_b » Tue Sep 20, 2011 10:57 pm

uksitebuilder wrote:Of course you are correct, I had a totally blank moment when I posted the above.

To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
seo_url.php

This works with v1.5.0.5 but not with v1.5.1

I've done it it in the phpmyadmin but the seo_url.php file seems to be different in 1.5.1

Whats the difference to apply ?

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by uksitebuilder » Tue Sep 20, 2011 11:00 pm

It works fine in 1.5.1 I have it running on my demo store: http://www.designs.org.uk which is default OC 1.5.1.2

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by dony_b » Tue Sep 20, 2011 11:09 pm

I get a blank page when I change the seo_url.php

why is this you think ?

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by uksitebuilder » Tue Sep 20, 2011 11:11 pm

Usually means some kind of php fatal error or possibly whitespace being injected either before th opening php tag or after the closing php tag.

Do your error logs give an indication ?

If you have compression turned on in your admin settings, turn it off for a moment and it may display on screen what the actual error is.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: jp1077 and 75 guests