17 replies
  • SEO
  • |
I have an old domain that I don't use anymore.

I want to redirect it so that anything having to do with the domain gets redirected to a single landing page on my new domain.

So if someone types in olddomain.com, www.olddomain.com, olddomain.com/whatever.php, etc. I want them to be redirected to www.newdomain.com/landingpage.php.

I don't want olddomain.com/contacts.htm to redirect to newdomain.com/contacts.htm. I want olddomain.com/contacts.htm and all other pages to go to newdomain.com/landingpage.php

What's the best code to put into my .htaccess file to do this?



I tried using this:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.NewDomain.com/landing.php [R=301,L]
It seems to work for me, but oddly enough at this link the guy says he is using that same line of code and it's redirecting pages page-for-page, which is what I don't want. http://www.webmasterworld.com/apache/3242480.htm
#301
  • Profile picture of the author KevinRB
    Surely if you set up a permanent 301 for your old domain on your hosting account and point it to your new landing page EVERYTHiNG will be forwarded to that single URL ??.
    {{ DiscussionBoard.errors[9152018].message }}
    • Profile picture of the author Electrical
      Originally Posted by KevinRB View Post

      Surely if you set up a permanent 301 for your old domain on your hosting account and point it to your new landing page EVERYTHiNG will be forwarded to that single URL ??.
      There are many different ways to do it.

      The way I want it is so that everything goes to 1 landing page.

      The way that other people want it, is so that if they type in olddomain.com/wfewe/tujyhwef.htm they get forwarded to newdomain.com/wfewe/tujyhwef.htm

      The code that I posted above seems to do it the way I want. However, in the link I posted, that guy uses the same code and says it works doing it the opposite way. So that's why I am trying to find the best possible code to use to make sure that the 301 redirect sends everyone to the landing page no matter what they type in.
      {{ DiscussionBoard.errors[9152148].message }}
  • Profile picture of the author Electrical
    Your link to Squidoo says to use the exact code that I posted.
    {{ DiscussionBoard.errors[9152316].message }}
    • Profile picture of the author PBScott
      Originally Posted by Electrical View Post

      Your link to Squidoo says to use the exact code that I posted.
      No it does not have the exact code you posted, a Ctrl F does not find it.

      Did you try the code I wrote for you ?

      That's $100 btw if it works.
      Signature

      If you don't look at this => Really Funny Shirts <= you missed something in life

      {{ DiscussionBoard.errors[9152674].message }}
      • Profile picture of the author Electrical
        Originally Posted by PBScott View Post

        Did you try the code I wrote for you ?

        That's $100 btw if it works.
        No, I didn't try it because you said that the code I had was wrong when it was exactly what the link you posted said to use.

        Instead of using a code that was written on the spot, isn't there a standard code that everyone agrees will work for this purpose? I'm not asking for anything customized, I'm sure tens of thousands of people have needed to redirect everything on an old domain to a landing page on a new one.
        {{ DiscussionBoard.errors[9152870].message }}
  • Profile picture of the author Kevin Maguire
    I'm not too sure why you would want to have the site still live, if you have no intention of ever using it, and the 301s required are to a single url destination.

    You can do this sort of 301 at domain registrar level.

    No need for the htaccess crap or even working with a live domain to begin with.
    {{ DiscussionBoard.errors[9153614].message }}
    • Profile picture of the author Electrical
      Originally Posted by Kevin Maguire View Post

      I'm not too sure why you would want to have the site still live, if you have no intention of ever using it, and the 301s required are to a single url destination.

      You can do this sort of 301 at domain registrar level.

      No need for the htaccess crap or even working with a live domain to begin with.
      Only because I have advertisements out there with the domain name and it's pretty catchy and easy for people to remember.

      What do you suggest I do at the registrar level? The domain is thru GoDaddy.

      Also, will this redirect every request to the landing page? Meaning, if they type in olddomain.com/whatever.htm will it send them to newdomain.com/landingpage.php like I want or will it send them to newdomain.com/whatever.htm like I don't want?
      {{ DiscussionBoard.errors[9153620].message }}
      • Profile picture of the author Kevin Maguire
        Originally Posted by Electrical View Post

        Only because I have advertisements out there with the domain name and it's pretty catchy and easy for people to remember.

        What do you suggest I do at the registrar level? The domain is thru GoDaddy.

        Also, will this redirect every request to the landing page? Meaning, if they type in olddomain.com/whatever.htm will it send them to newdomain.com/landingpage.php like I want or will it send them to newdomain.com/whatever.htm like I don't want?
        Yeah but you don't need to host a site on the domain for it still to be catchy.

        301 "Forwarding" is fairly straight forward. Will take you no more then 2 minutes and you're done.

        Forwarding or Masking Your Domain Name | GoDaddy Help | GoDaddy Support
        {{ DiscussionBoard.errors[9153640].message }}
        • Profile picture of the author Electrical
          Originally Posted by Kevin Maguire View Post

          Yeah but you don't need to host a site on the domain for it still to be catchy.
          I'm not hosting a site, I am redirecting a domain.

          301 "Forwarding" is fairly straight forward. Will take you no more then 2 minutes and you're done.

          Forwarding or Masking Your Domain Name | GoDaddy Help | GoDaddy Support
          The main question that I have been asking since the beginning is ignored yet again...
          {{ DiscussionBoard.errors[9153651].message }}
          • Profile picture of the author Kevin Maguire
            Originally Posted by Electrical View Post

            What's the best code to put into my .htaccess file to do this?
            This is the only question you asked, and I had no need to answer it as htaccess coding is not required for your problem.

            Originally Posted by Electrical View Post

            I'm not hosting a site, I am redirecting a domain.
            If you're hosting a .htaccess file, you're hosting a site.


            Can you 301 redirect all urls of an old domain to a single url on a new domain using only the registrar? YES you can.

            By the time it took you to post your reply you would have found that out already.

            Why people are even advising you about "REWRITE" rules and not "REDIRECT" rules is beyond me. Maybe they didn't read the question or have no clue what they're on about. idk.
            {{ DiscussionBoard.errors[9153670].message }}
            • Profile picture of the author Electrical
              Originally Posted by Kevin Maguire View Post

              This is the only question you asked
              No, it's not the only question I asked. :rolleyes:

              If you're hosting a .htaccess file, you're hosting a site.
              No, I am not hosting a site, there is no website there.

              You're trying to win some battle in your head. No one cares about your technicalities. It doesn't cost me any more money to keep that domain name with an htaccess file redirecting or not.

              Can you 301 redirect all urls of an old domain to a single url on a new domain using only the registrar? YES you can.
              I don't believe this is true. I believe any page added to the domain would pass thru to the new domain, which is exactly what I need to avoid.

              By the time it took you to post your reply you would have found that out already.
              Find out how? You are suggesting that I do something that I don't want to do. I asked for an htaccess redirect and all you have given me is grief.

              Why people are even advising you about "REWRITE" rules and not "REDIRECT" rules is beyond me. Maybe they didn't read the question or have no clue what they're on about. idk.
              Actually, I think that describes you to a T.
              {{ DiscussionBoard.errors[9153687].message }}
              • Profile picture of the author Kevin Maguire
                Originally Posted by Electrical View Post

                No, it's not the only question I asked. :rolleyes:

                No, I am not hosting a site, there is no website there.

                You're trying to win some battle in your head. No one cares about your technicalities. It doesn't cost me any more money to keep that domain name with an htaccess file redirecting or not.

                I don't believe this is true. I believe any page added to the domain would pass thru to the new domain, which is exactly what I need to avoid.

                Find out how? You are suggesting that I do something that I don't want to do. I asked for an htaccess redirect and all you have given me is grief.

                Actually, I think that describes you to a T.
                I'm not too sure where to start.

                Someone asks for help, you give them a better answer and route to take, and then they go all Charlie Babbit on you.

                A "question" ends with a question mark "?". You have only one question marked sentence in your original post. It asked this question, which I shall answer as clearly as I can for you.

                [QUOTE=Electrical;9153687]What's the best code to put into my .htaccess file to do this?[QUOTE]

                Now here is my answer.

                Your idea of how to perform 301 Redirects using the .Htaccess is wrong.

                Why?

                You are writing .htaccess rules around "url rewritting" when you should be using "url redirecting"

                What should I be using?

                This Code

                Code:
                Redirect 301 / http://www.newdomain.com/landingpage.php.
                Is this the best method to be used for the type of redirect I require?

                Absolutely not, this is probably the last choice I would make as there is a far simpler option of just doing the full 301 redirect from the point of registrar.
                {{ DiscussionBoard.errors[9153725].message }}
                • Profile picture of the author Electrical
                  Originally Posted by Kevin Maguire View Post

                  I'm not too sure where to start.

                  Someone asks for help, you give them a better answer and route to take, and then they go all Charlie Babbit on you.
                  Because it's not better. Your idea doesn't help me, as I explained very clearly.

                  There has been 1 very important issue that I have been asking since the beginning. You ignored that issue entirely and told me to do something that goes against my exact concern.


                  What should I be using?

                  This Code

                  Code:
                  Redirect 301 / http://www.newdomain.com/landingpage.php.
                  Once again you gave bad advice. That is actually the very first redirect that I used. The problem was that it redirected page for page. Meaning if someone typed in olddomain.com/oldpage.htm they would be directed to www.newdomain.com/landingpage.php/oldpage.htm

                  You see how that works? Do you now understand what I am trying to avoid?

                  I bet you do, but you're not the type to admit it...

                  Is this the best method to be used for the type of redirect I require?

                  Absolutely not, this is probably the last choice I would make as there is a far simpler option of just doing the full 301 redirect from the point of registrar.
                  And, as I already said and you ignored, doing that will also redirect page for page (like the example I gave above), which is what I DON'T want to happen.

                  How else can I explain this to you? Should I draw pictures?
                  {{ DiscussionBoard.errors[9153739].message }}
                  • Profile picture of the author Kevin Maguire
                    Originally Posted by Electrical View Post

                    Because it's not better. Your idea doesn't help me, as I explained very clearly.

                    There has been 1 very important issue that I have been asking since the beginning. You ignored that issue entirely and told me to do something that goes against my exact concern.



                    Once again you gave bad advice. That is actually the very first redirect that I used. The problem was that it redirected page for page. Meaning if someone typed in olddomain.com/oldpage.htm they would be directed to www.newdomain.com/landingpage.php/oldpage.htm

                    You see how that works? Do you now understand what I am trying to avoid?

                    I bet you do, but you're not the type to admit it...



                    And, as I already said and you ignored, doing that will also redirect page for page (like the example I gave above), which is what I DON'T want to happen.

                    How else can I explain this to you? Should I draw pictures?
                    That's the code. I didn't invent it. You're probably doing it wrong, or your servers screwing it. That happens sometimes with htaccess, and that's why I gave you a better solution.

                    You could try adding the * after the root directory, like this /*

                    You have a solution to your problem. I've given it to you very clearly in my original post.

                    It's not about the cost of hosting a domain, it's about the actions required to process a task. It requires less of you and your servers to 301 from your domain registrar.

                    If you don't like my solution.

                    Tough
                    {{ DiscussionBoard.errors[9153788].message }}
                    • Profile picture of the author Electrical
                      Originally Posted by Kevin Maguire View Post

                      That's the code. I didn't invent it.
                      No, that is exactly what you did, you took 1 single way to redirect and posted it here. There are dozens of other ways, but you are too stubborn to actually read the words I typed to see that I need the redirect to do something specific.

                      You could try adding the * after the root directory, like this /*
                      I don't want to play games like that, I explained this earlier in the thread. I'm not here to use my website as a beta test for your code trials. I said this earlier:

                      "Instead of using a code that was written on the spot, isn't there a standard code that everyone agrees will work for this purpose? I'm not asking for anything customized, I'm sure tens of thousands of people have needed to redirect everything on an old domain to a landing page on a new one."

                      You have a solution to your problem. I've given it to you very clearly in my original post.

                      It's not about the cost of hosting a domain, it's about the actions required to process a task. It requires less of you and your servers to 301 from your domain registrar.

                      If you don't like my solution.

                      Tough
                      Again, how many more times do you need it explained to you that the "solution" you posted is wrong?

                      How can I be more clear when I tell you that your solution does exactly what I don't want it to do?

                      I just don't understand...

                      From the very start I made my concern very clear, but you ignored it because it doesn't have a question mark after it...?

                      It's like talking to a child that just wants to be right.
                      {{ DiscussionBoard.errors[9154346].message }}
  • Profile picture of the author Electrical
    Ya see Kevin Maguire, I did exactly as you said. I set it thru the registrar to forward it. I gave it a couple of days to register.

    Now when I type in www.olddomain.com/whatever it takes me to www.newdomain.com/landingpage/whatever instead of just the landing page.

    That is EXACTLY what I did NOT want to happen, as I explained to you.

    Everything you said is wrong, if you were a man of any dignity whatsoever you would apologize for your behavior and bad advice in this thread.

    Now I am still stuck at the beginning looking for some type of redirect that will always send the user to the landing page.
    {{ DiscussionBoard.errors[9164178].message }}

Trending Topics