• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Website (subdomain?) Question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Website (subdomain?) Question

    I have a website (hosted with Easyspace if that helps).

    Currently, typing these addresses into the browser address bar both take you to the www/index.html file

    mywebsite.com
    www. mywebsite.com [ the space you can see clearly isn't really there ]

    Then I set up a sub-domain called 'thingy', so that I have a "mini site" accessible under:

    thingy.mywebsite.com

    But it turns out that people are trying to get to the mini site using www.thingy.mywebsite.com

    So I'd like to have some sort of redirect (could be in .htaccess could be a simple JS redirect, I don't care) that takes browsers to

    thingy.mywebsite.com

    I'm stumped. Any ideas?

    TIA

    #2
    apache - redirecting www.subdomain.example.com to subdomain.example.com - Stack Overflow
    Best Forum Advisor 2014
    Work in the public sector? You can read my FAQ here
    Click here to get 15% off your first year's IPSE membership

    Comment


      #3
      I don't know much about Easyspace. On a simplistic level, you need an extra DNS entry for www.thingy, but that'll only take you so far. Usually there's a Website Control Panel for something like "Redirect" or "Alias" or similar.

      I'm assuming that thingy.mywebsite.com is a different site to mywebsite.com?

      Comment


        #4
        Originally posted by vwdan View Post
        I don't know much about Easyspace. On a simplistic level, you need an extra DNS entry for www.thingy, but that'll only take you so far. Usually there's a Website Control Panel for something like "Redirect" or "Alias" or similar.

        I'm assuming that thingy.mywebsite.com is a different site to mywebsite.com?
        You need a CNAME record pointing www.thingy.example.com to thingy.example.com, I think. (Actually, TF's StackOverflow link looks like it covers things.)

        Comment


          #5
          Ah! Thanks (that was quick).

          The solution suggests that this code goes in .htaccess

          Code:
          <VirtualHost *:80> 
              ServerName www.subdomain.example.com 
              Redirect permanent / http://subdomain.example.com/ 
          </VirtualHost>
          But the apache docs suggest that this goes into a config file. Do you happen to know which is correct?

          Comment


            #6
            Originally posted by Platypus View Post
            Ah! Thanks (that was quick).

            The solution suggests that this code goes in .htaccess

            Code:
            <VirtualHost *:80> 
                ServerName www.subdomain.example.com 
                Redirect permanent / http://subdomain.example.com/ 
            </VirtualHost>
            But the apache docs suggest that this goes into a config file. Do you happen to know which is correct?
            It should work in both, if the server is set up to use .htaccess files - they act as a mechanism for extending the main configuration file.

            Comment


              #7
              Ok I'm trying this in two stages.

              I've added the CNAME record and now when I go to www.thingy.mywebsite.com I'm redirected to some sort of holding page that says "this domain name has been registered with yoursupportservices.co.uk followed by some sponsored links.

              Does the extra CNAME record take some time to propogate, like DNS ?

              Next up, if I add this to .htaccess:

              Code:
              <VirtualHost *:80> 
                  ServerName www.thingy.mywebsite.com 
                  Redirect permanent / http://thingy.mywebsite.com/ 
              </VirtualHost>
              Then visiting thingy.mywebsite.com gives an "Internal Server Error" while www.thingy.mywebsite.com still gives the holding page

              i.e. I can no longer visit thingy.mywebsite.com, which of course used to work. If I revert the .htaccess, it works again.

              Comment


                #8
                Originally posted by Platypus View Post
                Ok I'm trying this in two stages.

                I've added the CNAME record and now when I go to www.thingy.mywebsite.com I'm redirected to some sort of holding page that says "this domain name has been registered with yoursupportservices.co.uk followed by some sponsored links.

                Does the extra CNAME record take some time to propogate, like DNS ?

                Next up, if I add this to .htaccess:

                Code:
                <VirtualHost *:80> 
                    ServerName www.thingy.mywebsite.com 
                    Redirect permanent / http://thingy.mywebsite.com/ 
                </VirtualHost>
                Then visiting thingy.mywebsite.com gives an "Internal Server Error" while www.thingy.mywebsite.com still gives the holding page

                i.e. I can no longer visit thingy.mywebsite.com, which of course used to work. If I revert the .htaccess, it works again.

                The CNAME is a DNS record, but DNS propagates pretty quickly these days. It might be worth clearing the DNS cache on your local machine.

                With the .htaccess in place, do you see anything in the server error log? (I'm not sure if there should be anything or not, but that's usually my first port of call when trying to work out why none of this stuff works.)

                Comment


                  #9
                  Originally posted by Platypus View Post
                  Ok I'm trying this in two stages.

                  I've added the CNAME record and now when I go to www.thingy.mywebsite.com I'm redirected to some sort of holding page that says "this domain name has been registered with yoursupportservices.co.uk followed by some sponsored links.

                  Does the extra CNAME record take some time to propogate, like DNS ?

                  Next up, if I add this to .htaccess:

                  Code:
                  <VirtualHost *:80> 
                      ServerName www.thingy.mywebsite.com 
                      Redirect permanent / http://thingy.mywebsite.com/ 
                  </VirtualHost>
                  Then visiting thingy.mywebsite.com gives an "Internal Server Error" while www.thingy.mywebsite.com still gives the holding page

                  i.e. I can no longer visit thingy.mywebsite.com, which of course used to work. If I revert the .htaccess, it works again.

                  Where are you creating the .htaccess ?
                  Have you added an additional document root in your HTTP server config?

                  I would avoid using .htaccess files if I were you. Much safer to use CNAME records.
                  Don't believe it, until you see it!

                  Comment


                    #10
                    Also, see here for the syntax:

                    http://www.inmotionhosting.com/suppo...-domain-to-new
                    Don't believe it, until you see it!

                    Comment

                    Working...
                    X