Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default How to avoid this?

    Hi! I need help on this:
    I have a lot of urls indexed at google duplicating my home page:
    www.mysite.com/shop/index.php?alpha_filter_id=89
    www.mysite.com/shop/index.php?alpha_filter_id=64
    www.mysite.com.com/shop/index.php?alpha_filter_id=71

    etc etc
    How can i redirect without .htaccess all these urls to www.mysite.com/shop/ ?

  2. #2
    Join Date
    Nov 2007
    Location
    USA
    Posts
    889
    Plugin Contributions
    5

    Default Re: How to avoid this?

    I'd go into your Host Cpanel and create a redirect from there.

    You could create an index.php (or other) and add a redirect script to it which is not as reliable as doing it on your cpanel.

    <html lang=en><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Wind Shift</title><link rel="shortcut icon" href="/favicon.ico"></head><body><script type="text/javascript"> location = "/catalog/index.php";</script></body></html>

    Either way you must have access to your public folder.
    Redirects are the best way.
    Cheers!
    v2.2.1

  3. #3
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default Re: How to avoid this?

    Many thanks for your reply, Webskipper, but i havenīt Cpanel, and javascript redirecting isnīt good for serach engines.
    I want to know the method to do the redirecting required inside zencart, maybe into the head.php?

  4. #4
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default Re: How to avoid this?

    No one?

  5. #5
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default Re: How to avoid this?

    i have been pending 5 days trying to solve this...
    First i studied the doc about autoloaders trying to hook a "brute force"redirect, but doesnīt works...
    After that i included this at index.php:

    /**
    * Load general code run before page closes
    */
    if ($this_is_home_page)
    {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location:http://www.mysite.com/shop/');
    }

    doesnīt works...it redirects continously load after load...

    i thought maybe inserting this at main_template_vars:

    // elimina alpha filter si está en la página princpal index.php
    if ($this_is_home_page == true) {
    unset($_GET['alpha_filter_id']);
    unset($alpha_filter_id);
    function remove_query_param($url, $param)
    {
    $tokens = explode ('?', $url);
    $url_path = $tokens[0];
    $query_string = $tokens[1];
    $qs_array = parse_query_string($query_string);
    unset($qs_array[$param]);
    $new_query_string = '';
    return $url_path . $new_query_string;
    }
    }

    but donīt do nothing. Maybe in includes/modules/pages/index/header.php? maybe at the filter.php?


    Iīm desperate. My knowlege of php is near zero, and i can not make redirects at my host because it hasnīt mod_rewrite allowed...

    Please help me!!!

  6. #6
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: How to avoid this?

    is changing host an option. they sound pretty awful.

  7. #7
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default Re: How to avoid this?

    Not possible at this moment

    Can you help with the php grammar necessary to do it?
    or can you say me which file must i edit?

  8. #8
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: How to avoid this?

    Quote Originally Posted by tonibarcelona View Post
    Not possible at this moment

    Can you help with the php grammar necessary to do it?
    or can you say me which file must i edit?
    How about what you had before, but
    PHP Code:
      if( ereg("\?alpha_filter_id=[0-9]+$"$_SERVER['REQUEST_URI']) ) {
        
    header('HTTP/1.1 301 Moved Permanently');
        
    header('Location:http://www.mysite.com/shop/');
      } 
    That will catch the filter if it is the only variable. I think that is a brutal hack, but it's up to you.

    Personally I think that you are worrying about nothing, in time google will get a decent index of your site and those things will filter away.

  9. #9
    Join Date
    Feb 2007
    Location
    Barcelona
    Posts
    201
    Plugin Contributions
    0

    Default Re: How to avoid this?

    Quote Originally Posted by banswidthjunkie View Post
    How about what you had before, but
    PHP Code:
      if( ereg("\?alpha_filter_id=[0-9]+$"$_SERVER['REQUEST_URI']) ) {
        
    header('HTTP/1.1 301 Moved Permanently');
        
    header('Location:http://www.mysite.com/shop/');
      } 
    That will catch the filter if it is the only variable. I think that is a brutal hack, but it's up to you.

    Personally I think that you are worrying about nothing, in time google will get a decent index of your site and those things will filter away.
    Many thanks for your proposal. Maybe itīs abrutal hack, but by now is the only i have... At what fileis better inserting this? Filter.php? index.php?, or maybe to make a new php file and hooking it at auto-load?

    I worry about this because i have 23 "main pages" indexed at google with an alpha filte id!!! Very bad for the serps... That thisnīt happen to any other zen cart user?

  10. #10
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: How to avoid this?

    Personally I wouldn't put it anywhere. But you could try putting it where you had the bit of code that caused your site to continually loop.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How to avoid 10736 Paypal error?
    By nya1798 in forum PayPal Express Checkout support
    Replies: 2
    Last Post: 2 Dec 2011, 10:54 PM
  2. How do I avoid over selling?
    By erinn in forum General Questions
    Replies: 3
    Last Post: 7 Oct 2008, 02:32 PM
  3. Pages Wont Load / Apache Restart Fixes this... can I avoid this?
    By dontknowwhatimdoing in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 20 Sep 2008, 05:21 PM
  4. How to avoid mandatory account?
    By gsdcypher in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 9 May 2007, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg