Solved

Redirect sub domain to another website?

Posted on 2013-01-08
4
722 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 40

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
Resolve DNS query failed errors for Exchange
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses

752 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