htaccess 301 redirect problem...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kard63
    Confirmed User
    • Nov 2003
    • 8944

    #1

    htaccess 301 redirect problem...

    if I want to redirect www.example.com/turd/ and every page that begins with that part of the URL, but not redirect www.example.com/anythingelse/, and I want every page redirected to the hompage of a different domain.

    I've tried a few things, none worked. The search results are all cluster fucked with people wanting www or non-www, redirecting within the same domain, or redirecting each url from one domain to a new domain. I want every page I redirect to go to the same homepage, forget the extension on the end.

    If anyone knows how to do this I would appreciate the answer.
  • V_RocKs
    Damn Right I Kiss Ass!
    • Nov 2003
    • 32449

    #2
    Code:
    RewriteEngine On
    RewriteRule ^turd/(.+)$ http://www.adifferentdomain.com [R=301,L]
    RewriteRule ^turd/$ http://www.adifferentdomain.com [R=301,L]

    Comment

    • tiger
      Confirmed User
      • Apr 2002
      • 6986

      #3
      htaccess is awesome, so many useful things you can do with it.

      Comment

      • V_RocKs
        Damn Right I Kiss Ass!
        • Nov 2003
        • 32449

        #4
        Tired of running galleries through the main site?

        Comment

        • HorseShit
          Too lazy to set a custom title
          • Dec 2004
          • 17513

          #5
          hi v_rocks, thanks for cyber sex last night

          Comment

          • Kard63
            Confirmed User
            • Nov 2003
            • 8944

            #6
            Originally posted by V_RocKs
            Code:
            RewriteEngine On
            RewriteRule ^turd/(.+)$ http://www.adifferentdomain.com [R=301,L]
            RewriteRule ^turd/$ http://www.adifferentdomain.com [R=301,L]
            Thanks man I'll try that. I was looking for your ICQ earlier and then I noticed people leaving theirs for you. I assumed you don't have it posted. I was looking at your stats but I'm not familiar with a lot of the sponsors. Who performed best with, hmmm, oh hell what do I call them... pornstars who are popular (for now anyway, maybe not next year) but not under contract to studios, like all the chicks at Brazzers, Muffia, the ones that usually make up most of the top 20 at FREEONES, etc?

            Comment

            • Kard63
              Confirmed User
              • Nov 2003
              • 8944

              #7
              Originally posted by V_RocKs
              Code:
              RewriteEngine On
              RewriteRule ^turd/(.+)$ http://www.adifferentdomain.com [R=301,L]
              RewriteRule ^turd/$ http://www.adifferentdomain.com [R=301,L]

              This redirect didnt work at all. Most of the things I tried worked partially. I think I fucked something up.

              Comment

              • qxm
                Confirmed User
                • Jul 2006
                • 5970

                #8
                This is a nice place to find 301 redirect info:

                hxxp://www.isitebuild.com/301-redirect.htm

                ICQ: 266990876

                Comment

                • GrouchyAdmin
                  Now choke yourself!
                  • Apr 2006
                  • 12085

                  #9
                  Originally posted by V_RocKs
                  Code:
                  RewriteEngine On
                  RewriteRule ^turd/(.+)$ http://www.adifferentdomain.com [R=301,L]
                  RewriteRule ^turd/$ http://www.adifferentdomain.com [R=301,L]
                  Code:
                  <IfModule mod_rewrite.c>
                    RewriteEngine On
                    RewriteBase /turd
                    RewriteRule ^(.*?)$ http://www.adifferentdomain.com [R=301,L]
                  </IfModule>

                  Comment

                  • Kard63
                    Confirmed User
                    • Nov 2003
                    • 8944

                    #10
                    Originally posted by GrouchyAdmin
                    Code:
                    <IfModule mod_rewrite.c>
                      RewriteEngine On
                      RewriteBase /turd
                      RewriteRule ^(.*?)$ http://www.adifferentdomain.com [R=301,L]
                    </IfModule>
                    internal server error 500 on that one.

                    Comment

                    • GrouchyAdmin
                      Now choke yourself!
                      • Apr 2006
                      • 12085

                      #11
                      Originally posted by Kard63
                      internal server error 500 on that one.
                      That should work with Apache 1.2-2.x. Some hosts don't have AllowOverride set to All; you can try removing the <IfModule> directives, but that's just a safety harness.

                      Depending on your config, the terminator can be confusing it. Try this:

                      Code:
                      RewriteBase /turd
                      RewriteRule ^(.*) http://www.newhost.com/ [R=301,L]

                      Comment

                      • V_RocKs
                        Damn Right I Kiss Ass!
                        • Nov 2003
                        • 32449

                        #12
                        Originally posted by jdavis
                        hi v_rocks, thanks for cyber sex last night
                        You sexy bitch!

                        Comment

                        • Kard63
                          Confirmed User
                          • Nov 2003
                          • 8944

                          #13
                          Anyone else have a suggestion ?

                          Comment

                          • Kard63
                            Confirmed User
                            • Nov 2003
                            • 8944

                            #14
                            I'm desperate here. Does anyone know what could be wrong?

                            Comment

                            • Kard63
                              Confirmed User
                              • Nov 2003
                              • 8944

                              #15
                              Originally posted by V_RocKs
                              Code:
                              RewriteEngine On
                              RewriteRule ^turd/(.+)$ http://www.adifferentdomain.com [R=301,L]
                              RewriteRule ^turd/$ http://www.adifferentdomain.com [R=301,L]
                              This is redirecting the home page correctly but:
                              www.example.com/turd/?p=43
                              is getting redirected to: http://www.adifferentdomain.com/?p=43.

                              I want it to redirect to the homepage as well. I want it to drop the "?p=43". Anyone know what to change?

                              Comment

                              Working...