Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default 301 redirect and message to referrer help?

    im closing down my old shop livvylou.co.uk, as i have merged my products on my new site livvylougifts.co.uk

    i have placed the following redirect on my old site
    Code:
    Redirect 301 / http://www.livvylougifts.co.uk/index.php?main_page=index&cPath=62
    (i haven't got a like for like so i am simply diverting all traffic from the old to a category which is relevant to the previous content.)

    i would like to set up a notice that welcomes old traffic to the new page, in my understanding a 301 redirect should includes the referrer (in this case my old site)

    so i have used the code

    Code:
    <!-- old livvylou site welcome -->
    <?php
    
    $ref=$_SERVER['HTTP_REFERER'];
    $domain_search = "livvylou.co.uk";
    $ref_site = parse_url($ref, PHP_URL_HOST);
    
    if (preg_match("/$domain_search/i" , $ref_site))
    {
    echo "Exciting news!!!! Livvylou.co.uk and Livvylou Gifts have now merged to make large convenient place for you to find all your children's goodies. We have directede you to our baby and child gifts but we also have lots more categories now for personalised giftware. Thanks for stopping by!";
    }
    
    ?>
    <!-- old livvylou site welcome -->
    but this isnt working, are there any 301 gurus who can help out please? its quite urgent :)

    thanks in advance

  2. #2
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: 301 redirect and message to referrer help?

    I would dispense with stating anything on the old site and go right to the new.

    Put this code in the main .htaccess file on the old site.

    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^livvylou\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.livvylou\.co\.uk$
    RewriteRule ^(.*)$ "http\:\/\/livvylougifts\.co\.uk\new_site_message.html" [R=301,L]

    On the new site create a file called "new_site_message.html" stating what has happened and provide a link to the Home page of your new site.

  3. #3
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: 301 redirect and message to referrer help?

    ah thats brill! seems a lot easier too, thanks for the reply!

 

 

Similar Threads

  1. 301 redirect help
    By darrels in forum Basic Configuration
    Replies: 2
    Last Post: 17 Aug 2009, 09:28 PM
  2. Replies: 14
    Last Post: 2 Jul 2008, 03:40 PM
  3. Ultimate_SEO_URLs and 301 Redirect
    By 8 miles in forum General Questions
    Replies: 2
    Last Post: 25 May 2007, 11:48 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR