Post by Efficiency » Thu Oct 07, 2010 1:25 am

I have SEO turn on and can add any keyword for this purpouse:

category/stuffed_animals.html - if just add keyword "stuffed_animals.html"
I'm apparently getting "stuffed_animals.html/product_page(.html) - this is an ugly solution
and is there a function to add the html preffix to all pages

to get: category/stuffed_animals/teddy-bear.html and category/stuffed_animals.html ?

Newbie

Posts

Joined
Wed Oct 06, 2010 11:33 pm

Post by jayman » Thu Oct 07, 2010 2:17 am

first of all they are not static html pages. They are php files rendering html so you will not see that file extension. The seo keyword is not for keywords as you may think, write what you want the ending url to look like for ex. use your stuffed_animal in the seo keyword field is actually rewriting your url. Also make sure you renamed your .htaccess file from htaccess.txt

New member

Posts

Joined
Wed Apr 07, 2010 1:32 pm

Post by OC2PS » Thu Oct 07, 2010 4:28 am

You mean .html suffix.

Why do you want to have the URL end in .html ?

If you
1. turn on Search Engine Friendly URLs in Admin > System > Settings > Server
2. rename htaccess.txt to .htaccess

Then if you put SEO keywords for a category as stuffed_animals then the URL for the category will be something like www.yourdomain.com/opencart/stuffed_animals

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by Efficiency » Thu Oct 07, 2010 4:35 pm

Yes, I'm turn on SEO.
I'm need in the .html suffix for better SEO.
When a search engine googling my site it can think this is a manual made page that using the .html tecnology and rate my site better than other without the suffix (preffix).
There is a simple SEO trick.

Have you any ideas how to realized that I've mentioned?

Newbie

Posts

Joined
Wed Oct 06, 2010 11:33 pm

Post by OC2PS » Thu Oct 07, 2010 5:19 pm

I don't know how to achieve that.

But pages ending in .html do no better in terms of SEO than pages that don't end in .html

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by SteveSherry » Sun Oct 10, 2010 2:56 am

Ok, just to clarify, my 9 - 5 involves a significant amount of seo work, and i've never heard of your theory on adding suffixes. ???

anyway, the code you are looking for is:

Code: Select all

update url_alias
set keyword = concat(keyword,'.html');

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by jty » Sun Oct 10, 2010 11:35 am

Yer, I've never heard that of the magic suffix trick either. The world of SEO is full of urban myths
But I do require suffixes for a different reason being that I need to redirect from .html pages and I don't know how to achieve this with mod rewrite

Steve, I ran your solution and it only works partially.
It works for URLs that look like - shop/category.html
But for categories with parent_ids. It will present the URL as shop/parent_category.html/sub_category.html

Thanks for helping anyway. Guess the time has come for me to learn mod rewrite ..... groan ...

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by SteveSherry » Mon Oct 11, 2010 4:32 am

Sorry, I should have put a where statement in as well.

It should have read

Code: Select all

update url_alias
set keyword = concat(keyword,'.html')
where
query like 'product_id%';
to fix what you have done please runthis:

Code: Select all

update url_alias
set keyword = left(keyword,LENGTH(keyword)-5)
where
query not like 'product_id%';
probably not the most eloquent looking code, but it'll do the job.

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by SteveSherry » Mon Oct 11, 2010 4:38 am

This will give you shop/category/sub_category/product.html
it'll also give you shop/category/sub_category


Not exactly what you want, but getting better.

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by jty » Mon Oct 11, 2010 11:07 am

Thanks Steve and especially, thanks for caring about my data although it would have been my problem if I was stupid enough to mess with data without a backup :)
I thought of limiting the .html suffix with a where clause. That will save me about 900 product page redirects in the htaccess. But I'm still going to try and do the redirect from the .html to no .html using mod rewrite. It's just that mod rewrite looks like a bunch of hieroglyphics to me so it takes much longer to learn.

For the initial reason for this thread, .html in my view is not important for SEO reasons. But the world of SEO has many opinions and conflicting too.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by jty » Mon Oct 11, 2010 4:32 pm

Efficiency, I ran Steve's sql directly on the database so I could do a quick test
If you are familar with sql, you can do the same
If you don't know sql, then ...... ummm ....... be careful, be very careful

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by wilsun » Tue Jan 03, 2012 1:42 pm

SteveSherry wrote:Sorry, I should have put a where statement in as well.

It should have read

Code: Select all

update url_alias
set keyword = concat(keyword,'.html')
where
query like 'product_id%';
to fix what you have done please runthis:

Code: Select all

update url_alias
set keyword = left(keyword,LENGTH(keyword)-5)
where
query not like 'product_id%';
probably not the most eloquent looking code, but it'll do the job.

Which files i should change?

thanks

Newbie

Posts

Joined
Thu Sep 29, 2011 5:27 am

Who is online

Users browsing this forum: No registered users and 16 guests