Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fake URL redirection by administration


tgely

Recommended Posts

Did you lost something?

 

- I cannot say without any comprimise that this will give back you everything.

 

 

Hi all,

 

a fake HTTP/HTTPS URL recorder and administration redirection add-on just ready for population. This would be usefull when moving contents to new place or lost something from your new v2.3.4 shop.

 

 

Features in the first version

  • automatic url recording
  • automatic fake URL redirection handler
  • CSV export/import
  • editable URL redirection mode
  • online help
  • dashboard info modul
  • * wildcard character

Add-on place for install: http://addons.oscommerce.com/info/9321

 

 

Upload Usage

 

1. Add New URLs

If you would like upload new URL redirections from csv file, then leave empty the "redirects_id" column value

"redirects_id";"old_url";"new_url";"date_added";"latest_hit";"last_modified";"error_code";"priority";"counter";"url_redirects_mode";"url_redirects_status";
"";"product_info.php?products_id=100";"";"2015-06-01 13:09:27";"";"";"302";"1";"0";"301";"0";

2. Update URLs

 

After edited downloaded csv file save it and upload for activate modifications for the live site.

3. Error in Uploads

 

If you try upload an exists URL when is not set or without "redirects_id" than the table will not be upgrade/add the record.

 

 

 

Thanks to @@altoid who donated the project.

Edited by Gergely
addon link

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Apparently, over the years every time I reorganized my shop listings, such as changing  or relocating categories, that caused issues with google and other search engines because there was no 301 redirects done for the changes.  @@Gergely offered the beta version, which allowed me to identify redirect problems and change them to valid url with a proper 301 redirect.   :thumbsup:

 

I just updated to the new release.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Phil, this URL works the same as support link on all admin site like "http://www.oscommerce.com".

Try this: what is my user agent?

<a href="http://whatsmyuseragent.com/" target="_blank">what is my user agent</a>

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I try to ask Harald remove the help request site to the official oscommerce website if it would be more comforting.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@gvv

 

I think yes. You should put one row into server_error.php

 

After:

  require('includes/application_top.php');

Add:

$eID = http_error_handler();

And ignore upload the following files from url redirect addon

- catalog/http_error.php

- catalog/includes/languages/english/http_error.php

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I'm misunderstanding something...not sure what though...

 

 

 

If I hit: privacy_GONE.php

I am redirected to: privacy.php

 

If I hit: product_info.php?products_id=9 (deleted product for testing)

I get: "Product not found!" (the usual osc error message)

What I expect: redirect to products_id=10

Link to comment
Share on other sites

@@burt

Sorry i forgot to show product_info.php code reorganization for redirections.

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  if (!isset($HTTP_GET_VARS['products_id'])) {
    tep_redirect(tep_href_link(FILENAME_DEFAULT));
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  $product_check = tep_db_fetch_array($product_check_query);

  if ($product_check['total'] < 1) $result = http_error_handler('302');

  require(DIR_WS_INCLUDES . 'template_top.php');

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Gergely

 

When I'm trying 'Download in CSV format', I download blank excel file.

 

Also in admin,tools  HTTP Error Pages and Redirects table in HTTP Error Code section for all links shows code 999.

 

You probably dont have write permissions of your admin directory. This is correct.

For better downloads probably have to edit FS_OUTPUT_PATH constant in youradmin/ext/modules/csv/csvExpImp.php

 

Replace with your tempdir name

define('FS_OUTPUT_PATH', '/mytemp');

and give write permissions 0755 or 0777 to it.

 

 

'999' errors means that you dont set errorhandler function with '302' or whatever you want.

$result = http_error_handler('302');

What seo URL do you have?

 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@Gergely

 

The ability to redirect products handy.  However when I set up an 410 server error for a deleted product,  I am taken to a blank page, rather than a 410 error page with some sort of explanation for the human visitor.

 

Checking logs, the correct 410 server error is generated, so that's a good thing.

 

So for human visitors would not a error page with an explanation be better?

 

I suppose another alternative would be to 301 redirect a deleted product to some other appropriate page on the website be it another product or even to a category.

 

What are you thoughts?

 

Thanks

 

 

@@burt

Sorry i forgot to show product_info.php code reorganization for redirections.

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  if (!isset($HTTP_GET_VARS['products_id'])) {
    tep_redirect(tep_href_link(FILENAME_DEFAULT));
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  $product_check = tep_db_fetch_array($product_check_query);

  if ($product_check['total'] < 1) $result = http_error_handler('302');

  require(DIR_WS_INCLUDES . 'template_top.php');

 

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Hi everybody!

The next important addon will be supported in next release http://addons.oscommerce.com/info/9206for inside default_missing_image errors.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@Gergely

 

The ability to redirect products handy.  However when I set up an 410 server error for a deleted product,  I am taken to a blank page, rather than a 410 error page with some sort of explanation for the human visitor.

 

Checking logs, the correct 410 server error is generated, so that's a good thing.

 

So for human visitors would not a error page with an explanation be better?

 

I suppose another alternative would be to 301 redirect a deleted product to some other appropriate page on the website be it another product or even to a category.

 

What are you thoughts?

 

Thanks

What will be with the human navigation on a blank page?

 

Redirection would be better to another page. We can use messagestack to give some information for humans.

Edited by Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

What will be with the human navigation on a blank page?

 

Redirection would be better to another page. We can use messagestack to give some information for humans.

 

I think in most cases a redirect to another page would work. In fact would that not be better for search engine SEO? A 301 vs say a 404 or 410?

 

But for those instances where a product or category simply are no longer available in any form on a website, I'd think a message saying 

 

"Sorry but the page you are looking for is not available at [shop Name}

 

Please feel free to view our other items.

 

You may search here [searchbox for Shops Products and Categories}"

 

Or something like that.   :)

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Its not SEO question. First its business. The best for selleing if something has gone (410) than offer another alternatives.

Say something like this with a redirection:

 

 

Sorry but your requested url/product has gone away. See this alternative page.

 

 

 

 

If you dont have alternatives than its a big problem. You probably lost money.

 

After install URL redirection module to my website, I rebuild some important lost page to get back visitors and offer new alternatives with redirections.

 

You could use the redirection module old url "frequently weight" to decide is it important or not. Secondly this is the SEO question.
 

 

For alternative URLs building you could use advanced_search_result.php to offer more links. And would be good the messagestack to say something for humans.

 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Also in admin,tools  HTTP Error Pages and Redirects table in HTTP Error Code section for all links shows code 999.

 

 

Change the code in server_error.php

 

$result = http_error_handler($_GET['id']);
Edited by Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Here's an example of a 302 status for a product I once had in the shop.  

 

-p-526.html

 

Looking through my database, I don't see that product ID, so I assume it's been deleted.  In this case because I don't know what it was, I can't accurately redirect to another product or category.

 

So I'll probably set it at 410 status with the new url of /http_error.php

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

redirection from software-c-222.html to /software-c-2.html doesnt work.  

Yes its true. /index.php/cPath/222 HTTP header response is 200 and say

 

 

 

There are no products available in this category.

so if you would like to do something with fake categories you should install a cpath validation mod like this

https://github.com/Gergely/oscommerce2-addons/compare/cPath_validation

 

or probably could help a redirection directly from the .htaccess

 

See previous discussions http://www.oscommerce.com/forums/topic/381443-google-duplicate-content-with-strange-cpath-variable-indexed/

 

 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@altoid

 

-p-526.html is a frequently fake URL? I think this link would not be so important if no product name. Maybe a bad link from product description?

 

If you dont know the source of the link than try at google administration tool where you could find a link source help.
 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@altoid

 

-p-526.html is a frequently fake URL? I think this link would not be so important if no product name. Maybe a bad link from product description?

 

If you dont know the source of the link than try at google administration tool where you could find a link source help.

 

 

 

Thanks for the info.  I'm not sure the source but this particular shop goes back years online and I've changed categories locations etc. a lot so it's no surprise to me now how many bad urls exist out there for this shop.  Not necessarily all google.

 

Whatever is indexing some of these, has bad urls going back years.  For example I discontinued a product line several years ago, and even now those urls are showing up in url redirects.

 

I'm fixing them with the url redirect add on.  Having the capability to do this with categories and products is a big deal to me so I'm glad you put this together.  :thumbsup:

 

One other note, for my situation I've found it much more convenient to manage many url redirect changes via phpMyAdmin via update queries.  Just FYI on that.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Hi all,

 

next release is pushed on. Nothing to do only upload admin files and hit the url redirection menu.

 


@@altoid

There is a wildcard * solution for more redirections in one step. Did you see it?

Does csv downloads/uploads work for you?

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...