Jump to content

Friendly URLs in search results


Recommended Posts

I have friendly urls enabled, but when one of my product pages shows up in google search results, it doesn't show the friendly url but rather shows the address as mysite.com/product.php?id_product=76.

My htaccess file is below. Is there anything I can do to force google to use the friendly url address?

I'd really appreciate any help or suggestions.


# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /404.php

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Actually Prestashop still has links in the site to the old Non Friendly URLs, those are used for pagination, sorting and similar links.

The problem is that once google sees that address, unless you tell it that it is no longer in used (using a 301 redirect), than they will keep going to it and indexing it.

I have create a module (Duplicate URL Redirect) that automatically redirects all duplicate URLs, you can check out my site or the "Offers" section for more info

Link to comment
Share on other sites

Quick question. I've enabled friendly url and made 301 redirects. Now I noticed in the statistics, that sometimes some customers are currently at page 404.php. I've checked in FO, everything is OK, every link works.

Do you maybe know why the stats show 404?

Link to comment
Share on other sites

What 301 redirects did you do?

Any idea what are the pages that lead to the 404 error?

Do you have Google webmaster tools set up?

Did you try googling site:yoursite.com to see what pages google has indexed?

Did you delete any pages lately? if there are still links to them, search engines will keep crawling them and will take a while to remove them.

Link to comment
Share on other sites

What 301 redirects did you do?
I used your module duplicate URL redirect.

Any idea what are the pages that lead to the 404 error?
If I look stats by using module statstrackvisits:
- one visitor came to the first page and stayed there for 10 hours - resulting in 61 error: page 404.php
- once I tried to use send to friend module, which works perfectly, stats shows that there was several 404.php pages.

I see a pattern when a visitor is inactive for few minutes that leads to 404 page in stats.

Do you have Google webmaster tools set up?
Yes, I did. There is no not found crawl errors. Only restricted by robots and unreachable.

Did you try googling site:yoursite.com to see what pages google has indexed?
Yes. Since I did duplicate 301 redirects 2 days ago, google didn't indexed them yet. There are still old non-friendly links.

Did you delete any pages lately? if there are still links to them, search engines will keep crawling them and will take a while to remove them.
No, I didn't delete any pages.


Oh, and another thing, since I have an expert "on the line". I had a question here, if you might have a clue.

Thanks in any case.

Link to comment
Share on other sites

I google webmaster tool is not reporting it, than it may be related to a bad URL that the user is entering.

The other thing that comes to mind is that you have a link to a missing image somewhere which can cause a 404 error.

If when you browse your site, you don't get that error, I wouldn't worry too much about it, especially if it doesn't show up in the webmaster tools.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...