Jump to content

How to redirect to not get error in SEO


Recommended Posts

Hi All!

 

Let me ask you please!

 

When I switch off a product (because not available) there is an error message "product no longer available

 

But google webmaster tools do not like this and give us a faulty point!

 

I made a CMS page mysite.com/content/product-not-available.html

 

How can I redirect the unavailable products to this site instead of simple 404.php??

 

We use Ps. 1.4.8.2

 

Please help me!

 

Thanks

Link to comment
Share on other sites

In controllers/productcontroller.php you could redirect the page to your page, instead of showing the error box:

(code from PS 1.4.6.2, hope that it's similar to yours)

 

 

 

{

// header('HTTP/1.1 404 page not found'); // comment out these two lines

// $this->errors[] = Tools::displayError('Product is no longer available.');

 

header("Location: http://www.mysite.com/content/product-not-available.html"); // add this line

 

}

 

(Not sure if you officially still need to give a http:/1.1 header first)

 

My 2 cents,

Pascal

  • Like 3
Link to comment
Share on other sites

Hi,

 

I also had these "fault" in google webmaster tools and I also changed the lines in productcontroller.php a few weeks ago, but I'm getting now a new fault in GWT saying I'm using "soft 404".

 

here is the GWT message

While crawling your site, we have noticed an increase in the number of transient soft 404 errors around 2012-11-20 22:00 UTC (London, Dublin, Edinburgh). Your site may have experienced outages. These issues may have been resolved. Here are some sample pages that resulted in soft 404 errors:

 

here is the page about soft 404

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=181708

 

So, now I d'ont know what to do : 404 or 301 generate both errors in GWT !!

Link to comment
Share on other sites

Hmm, as I read the google message, they don't care that much if there's a 404 error (can't imagine it really punishes your site severely for having pages like this...), but they DO like the error number to be announced clearly.

 

So maybe add the first line that we commented out... (The one that calls the 404 error)??

 

 

Link to comment
Share on other sites

Hi Pascal!

 

It is working, but let me an other question!

 

What if I delete a product?

 

Your solution only works when a product swtched off (inactivated)

 

I should need to redirect too when I delete a product and the message is simply "product not found"

 

Please advise me where else could I put an other header(location... line???!!

 

Thanksd

 

Fitgura

Link to comment
Share on other sites

Hmm, how would you go to that page in the first place, if the product is really gone? Normally, there should not be any links anymore then...

 

When time, I'll see if I can think of a scenario and try to give some idea how to handle.

Please help think if this scenario is realistic and worth the efforts, though...

Link to comment
Share on other sites

Hi Pascal!

 

I solve it :) as you advise at prodct no longer available

 

I put a same header to the product not found line (in productcontroller.php line 94-95)

 

Just I don't know what the google will think about this redirection if a lot of products are unavailable almost 9000 deleted or inactive :)

 

I hope the negative points will decrease I'll see.

 

Thanks again!

Link to comment
Share on other sites

You can also get http://www.prestashop.com/forums/index.php?/topic/39736-module-duplicate-url-redirect-redirect-all-duplicate-and-non-seo-friendly-urls-to-the-default-friendly-url/

 

It actually uses a 302 redirect (which is better) for disabled products / categories, and redirects the the parent category (along with other useful redirects),

Link to comment
Share on other sites

Hi Tomreg!

 

Do you think is your module could solve my problem??

 

Because anything I do google is just spread more and more faulty point!

 

Huh! I'm really nervous now! under a day increased with 400 NOT found link in webmaster tools!

 

Even I redirect the deleted products to a cms page - for google no matter and will get an other pagerank point from us!

 

Drive me crazy, please help me!

 

PS. 1.4.8.2

 

Thanks!

Edited by fitgura (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  On 2/15/2013 at 1:22 PM, tomerg3 said:

Yes, it will help, there are more than 1,000 customers using it (including us on our site).

 

It takes google about 1-3 months to update their DB, but you will be able to see right away that they get redirected.

 

Hi Tomerg!

 

I did buy your module install it and upload the FontController.php but what the next??

 

What could I see??

 

Before that I did what Pascal offered to me...

 

I don't know how to decide what your module do??

 

How to test it?

 

Please advise

Edited by fitgura (see edit history)
Link to comment
Share on other sites

Once you copy the override file, the module is active, and it would automatically do all the redirects it is designed to.

 

You can test to make sure it is active by going to a product page, and changing the ID in the URL to a high number that doesn't exist, if it gets redirected to the homepage, the module is working.

 

If you get a 404 error, something is not correct, you can use the contact form on our site for support.

Link to comment
Share on other sites

  On 3/26/2013 at 2:49 PM, tomerg3 said:

Once you copy the override file, the module is active, and it would automatically do all the redirects it is designed to.

 

You can test to make sure it is active by going to a product page, and changing the ID in the URL to a high number that doesn't exist, if it gets redirected to the homepage, the module is working.

 

If you get a 404 error, something is not correct, you can use the contact form on our site for support.

 

Hi Tomerg!

 

Thanks it is working perfectly :)

 

Kind Regards

Fitgura

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...