Solved

Redirect sub domain to another website?

Posted on 2013-01-08
4
715 Views
Last Modified: 2013-01-11
Hi,
I have a Windows 7 hosts file below that is being ignored/bypassed when I connect to the interent via a 3G moderm which uses a proxy server.

C:\Windows\System32\drivers\etc\hosts

123.456.56.232            www.mywebsite.com
123.456.56.232            mywebsite.com
123.456.56.232            www.otherwebsite.com
123.456.56.232            otherwebsite.com

Basically I use the host file to test/build websites on new hosting accounts before moving them there.
I can't use the host file and if I try cpanel temp link http://123.456.56.232/~mywebsite the website layout is not correct.

If I created a subdomain from another domain I own (say redirect.com) could I point a sub domain to this test site by creating a DSN record at my registrar to point to the test site?

For example something like
mywebsite.redirect.com --> www.mywebsite.com @ 123.456.56.232
otherweb.redirect.com --> www.otherwebsite.com @ 123.456.56.232

If so how would I do it, any ideas or suggestions would be appreciated.

Thanks
0
Comment
Question by:sabecs
4 Comments
 
LVL 20

Expert Comment

by:netcmh
ID: 38757329
Both websites in your hosts file point to the same IP address. That could be your problem.

You could do a subdomain, a php script or anything else to redirect.
0
 
LVL 39

Expert Comment

by:footech
ID: 38757371
You can create any entries in DNS to point at a particular IP.  So if you own "redirect.com", create an A record for "website1" in that domain, and point it at the IP that you want.  But remember, this only resolves an IP.  If your website is relying on a GET request for a particular URL (e.g. www.website.com), a request to website1.redirect.com, even if it returns the same IP as www.website.com, will not get the right content.  The same is true if you created CNAME records in place of A records (a CNAME references another FQDN, vs. an A record which references an IP).
0
 

Author Comment

by:sabecs
ID: 38757701
Thanks for the feedback. In that case does anyone know how to bypass a proxy server, perhaps using another dns service provider?
0
 
LVL 11

Accepted Solution

by:
RedLondon earned 500 total points
ID: 38757996
Rather than using the hosts file on your PC to trick it into seeing something that's not really there, why not create the development site's account as dev.mydomain.com.  That way you bypass the need to bypass the proxy (and the need to have the hosts file at all)

If you have access to WHM and you're developing on the same server as the live website lives, you just create a new account as normal and specify dev.mydomain.com as the hostname - it'll be handled completely seperately from mydomain.com's actual hosting account.  You can then upload to, and view files on, dev.mydomain.com without further changes.

If you're not developing on the same server as the live website uses, create the new account dev.mydomain.com on the development server, and then create a subdomain on the live site's server as you did before, giving the development server's IP address.

This way, provided you don't hardcode the hostname dev.mydomain.com or its home directory path anywhere, then your development will work when you go live by copying it to www.mydomain.com in its original place.  If you do hardcode the home directory path or the hostname anywhere, you can just search/replace for it at the end.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Home Optimum Online Internet timeout problems. DNS issue? 36 2,025
Macbook Sierra OS OpenVPN issue 13 83
DNS @ Naked Domain Record 5 84
DNS Server 7 27
This article is intended as an extension of a blog on Aging and Scavenging by the MS Enterprise Networking Team. In brief, Scavenging is used as follows: Each record in a zone which has been dynamically registered with an MS DNS Server will have…
There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question