Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Redirect sub domain to another website?

Posted on 2013-01-08
4
Medium Priority
?
730 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 21

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 41

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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
Occasionally you run into the website or two that will not resolve properly using your own DNS servers.  Some people simply set up global forwarders for their DNS server.  I don’t recommend doing this because it can cause problems resolving addresse…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

886 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