7 Replies Latest reply on Apr 6, 2010 2:46 PM by 370H55V

    Domain Forwarding

    mshef534 Level 1

      Good Morning,

       

      I have been purchasing domains from GoDaddy.  For example I purchased www.sample.com.  But the only way I can view any of my pages is like this: www.sample.com/landing.aspx or www.sample.com/register.html.  How can I utilize my main domain?  I would like the www.sample.com/register.aspx to show up when the user types in www.sample.com. 

       

      Hope this makes sense.  Thank you.

       

      Melanie

        • 1. Re: Domain Forwarding
          370H55V Level 4

          There are essentially two ways to do it:

           

          There are two easy ways to do this:

           

          First Method: (preferred  and best way)

           

          This method  uses the HTTP Location header, like this:

           


          <?
          header("Location: new_page.php");
          ?>

          Substitute "yourdomainname.com/landingpage.html" for "new_page.php" if you know what I mean. The whole thing goes on the very first line of the HTML code, before anything else. That wya when someone types www.sample.com in their address bar, they are redirected to www.sample.com/register (or landing).aspx right from the index page.


          The  header() function sends raw HTTP headers to the user's browser. Therefore, you need to do this before sending any other output to the  browser, just as you would when setting a cookie. There are two  advantages to this method. First, it is instant, and the intermediate  script does not appear in a web browser's history. Second, because it is  HTTP based, it does not require a web browser to process; automatic web  crawlers and programs such as wget understand it.

           

          Second Method:

           

          However,  if you would like to show an intermediate page to the user with a  delay, you need to use a different method that uses the HTML  <meta> tag. It's pretty simple; to send a user to a different page  after displaying the current page for five seconds, put the following  in your HTML header:

           


          <meta http-equiv="Refresh"  content="5;URL= new_page.php" />

           

          All  web browsers understand this, but automatic page crawlers sometimes do  not. In addition, this intermediate page will show up in the user's  browser history. Beware, page refresh in meta tags may be considered  spam by search kings like google and yahoo.
          • 2. Re: Domain Forwarding
            mshef534 Level 1

            Thanks for the response.  Are you suggesting to do this in Dreamweaver code or though IIS?

            • 3. Re: Domain Forwarding
              370H55V Level 4

              You should be able to just add the header() to your DW code and with the correct address, it will redirect.

               

              I use it when I'm doing "facelifts" to redirect to a "construction" page, then remove it when the work is done.

              • 4. Re: Domain Forwarding
                mshef534 Level 1

                I guess I am confused exactly where and how I would add this code.  If I gave you examples of my actual site would you be able to show me?

                • 5. Re: Domain Forwarding
                  370H55V Level 4

                  Paste

                   

                  <?
                  header("Location: new_page.php");
                  ?>

                   

                  into the absolute very first line of code on the page(s) you want to re-direct. Substitute new_page.php with the name (address) of the page where you want people to "land".

                   

                  It goes above

                   

                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                  <head>


                  Like this:

                  <?
                  header("Location: new_page.php");
                  ?>

                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                  <head>

                   

                   

                  That way the very first thing the browser reads is the redirect command. Before ANY of the page information, before the page type, before the header, before anything. It will then take the visitor to the proper landing page.

                  • 6. Re: Domain Forwarding
                    Tiny_Guys Level 1

                    Not so sure that's gonna work for you on an ASP page.

                    • 7. Re: Domain Forwarding
                      370H55V Level 4

                      On a redirect from a straight HTML page TO an ASP, it should.

                       

                      I've never used it to send anyone to an ASP page, so I could be way wrong.

                       

                      Please correct me if I am.