Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 4 of 4

This is a discussion on 301 Redirect help in the Open Discussion & Chit-chat forum
I thnk this should belong in the clients helping clients but there is not a clear area to post in. Jag just a suggestion there ...

  1. #1
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,646

    301 Redirect help

    I thnk this should belong in the clients helping clients but there is not a clear area to post in.

    Jag just a suggestion there should be a html section some where.

    Any way heres the problem.
    I have a 301 redirect problem.I need to redirect http://domain.com to http://www.domain.com. This is a Search Engine Optimazation issue.

    I have tried a lot of different redirects. The only one that actually does
    what I need is: ( by the way I need the redirect to show in the headers as well as redirecting to the page. )

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]
    </IfModule>

    The above works great until a visitor places an order.
    They arrive at the first page of the shopping cart as they should.
    http://www.domain.com/cgi-bin/autocart.pl

    There they need to click to the next page for the secure cart to enter CC info.
    https://secure.domain.com/cgi-bin/autocart.pl

    Using the above redirect when the customer clicks to the next page they are
    returned to https://www.domain.com/cgi-bin/autocart.pl which of course is an error page.

    Any suggestions will be greatly appreciated.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I'm in a time crunch, Connie, but...

    On face value, I don't know what you need all that stuff for. I had to do a 301 a while back. This is all I used:
    Code:
    Redirect 301 /odp.php http://www.lenon.com/modules.php?name=ODP
    Using that as a model, I think all you would need is:
    Code:
    Redirect 301 / http://www.domain.com/
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,304
    I don't have time to test this right now, Connie, but maybe you could try something like this:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^https://secure.domain.com(.*)$ [NC]
    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]

    Just add something like that line before yours... There is an implicit AND between the conditions... so both have to be true to be rewritten.

    So if it's NOT your secure domain AND
    it's NOT www.domain.com
    make it www.domain.com

    Good luck.
    Last edited by Ron; 08-20-2004 at 09:23 PM.

  4. #4
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,646
    Hey Vin and Ron. Thanks for the attempts to help.

    Vin your first example will only work with relative links within the site.
    You can also use Redirect permanent rather than Redirect 301.
    I do use some redirects for pages that have been renamed.

    I have tried to use that to Redirect permanent /http://domain.com http://www.domain.com

    The header still display a 200 code rather than a 301.

    I haven't tried this but I suspect that redirect permanent /index.htm http://www.comain.com
    would work for internal relative links and that would change the http://www.domain.com/index.htm
    to http://www.domain.com

    Tried your second example. The only page I can access is the page I use for my
    personal home page. Any link I clicked on resulted in a dialog box that
    said the page was not accessible and something else about cookies.

    Ron,

    I really thought your solution would work due to the clause you added. I ended up
    with the same problem as the code I originally posted.

    When trying to go from the unsecure page to the secure page This is the error
    message on the page.

    >> You are missing a hidden field, possible mis-configuration. <<
    The error logs show this error:

    >> /home/domain.com/public_html/.htaccess: RewriteCond: bad argument line '%{HTTP_host}!^www\\.domain\\.com$'\n <<

    >> http://www.domain.com/cgi-bin/autocart.pl still still shows in the address bar <<

    I appreciate both of your attempts and suggestions to solve this problem.

    Hope you both had a great weekend since it's almost over.


    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

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
  •