Redirect

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mariusz@polbank.info

    Redirect

    Hello

    I want to redirect www.mysite.com/aaaa/p1/p2/p3 to www.mysite.com/bbbb/
    p1/p2/p3,
    because Google has indexed sites with 'aaaa' and 'bbbb'. But they are
    the same sites.


    I can't do it in .htaccess file becasue I'm taking p3 parameter from
    mysql database.
    So I think that only way is to do it in PHP.
    I'm a complete novice at redirects. So maybe anyone could help
    me....how to do it?


    MM

  • Rik

    #2
    Re: Redirect

    On Fri, 16 Feb 2007 19:36:18 +0100, <mariusz@polban k.infowrote:
    Hello
    >
    I want to redirect www.mysite.com/aaaa/p1/p2/p3 to www.mysite.com/bbbb/
    p1/p2/p3,
    because Google has indexed sites with 'aaaa' and 'bbbb'. But they are
    the same sites.
    >
    >
    I can't do it in .htaccess file becasue I'm taking p3 parameter from
    mysql database.
    Why not?

    RewriteEngine On
    RewriteRule ^/aaaa(.*)$ /bbbb$1 [L,R=301,QSA]
    --
    Rik Wasmus

    Comment

    • Mike Russell

      #3
      Re: Redirect

      <mariusz@polban k.infowrote in message
      news:1171650978 .889006.138220@ j27g2000cwj.goo glegroups.com.. .
      Hello
      >
      I want to redirect www.mysite.com/aaaa/p1/p2/p3 to www.mysite.com/bbbb/
      p1/p2/p3,
      because Google has indexed sites with 'aaaa' and 'bbbb'. But they are
      the same sites.
      >
      I can't do it in .htaccess file becasue I'm taking p3 parameter from
      mysql database.
      So I think that only way is to do it in PHP.
      I'm a complete novice at redirects. So maybe anyone could help
      me....how to do it?
      No PHP needed. Use html's refresh tag to redirect each page individually.

      --
      Mike Russell



      Comment

      • Rik

        #4
        Re: Redirect

        Mike Russell <RE-MOVEmike@Curvem eister.comRE-MOVEwrote:
        No PHP needed. Use html's refresh tag to redirect each page
        individually.
        Which would:
        1. Increase the load on your server.
        2. Not be clear to search engines.

        --
        Rik Wasmus

        Comment

        • Curtis

          #5
          Re: Redirect

          Rik wrote:
          On Fri, 16 Feb 2007 19:36:18 +0100, <mariusz@polban k.infowrote:
          >
          >Hello
          >>
          >I want to redirect www.mysite.com/aaaa/p1/p2/p3 to www.mysite.com/bbbb/
          >p1/p2/p3,
          >because Google has indexed sites with 'aaaa' and 'bbbb'. But they are
          >the same sites.
          >>
          >>
          >I can't do it in .htaccess file becasue I'm taking p3 parameter from
          >mysql database.
          >
          Why not?
          >
          RewriteEngine On
          RewriteRule ^/aaaa(.*)$ /bbbb$1 [L,R=301,QSA]
          --Rik Wasmus
          mod_rewrite is not always needed, and should be avoided, when
          RedirectMatch will do. Apache has the very cool RedirectMatch directive.

          RedirectMatch seeother ^/aaaa(.*)$ http://www.mysite.com/bbb$1

          Comment

          • OmegaJunior

            #6
            Re: Redirect

            On Sat, 17 Feb 2007 05:21:22 +0100, Rik <luiheidsgoeroe @hotmail.comwro te:
            Mike Russell <RE-MOVEmike@Curvem eister.comRE-MOVEwrote:
            >No PHP needed. Use html's refresh tag to redirect each page
            >individually .
            >
            Which would:
            1. Increase the load on your server.
            2. Not be clear to search engines.
            >
            And some browsers allow the user to halt that kind of redirect.

            --
            Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

            Comment

            • mariusz@polbank.info

              #7
              Re: Redirect

              And what if it looks like this?

              www.mysite.com/aaaa/p1/p2 to www.mysite.com/bbbb/p1/p2/p3

              I have no p3 parameter in old link. I must get it from database and
              add it on the end of new link.
              The most important is p1 - ID of an article...

              Comment

              • Jerry Stuckle

                #8
                Re: Redirect

                mariusz@polbank .info wrote:
                And what if it looks like this?
                >
                www.mysite.com/aaaa/p1/p2 to www.mysite.com/bbbb/p1/p2/p3
                >
                I have no p3 parameter in old link. I must get it from database and
                add it on the end of new link.
                The most important is p1 - ID of an article...
                >
                If the important part is p1, how does p3 change? Do you pull it out of
                thin air?

                Can you give some examples of exactly what you want? I would think it
                would be possible to handle this without having to create p3 from a
                database.

                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                Working...