Solved

Appending sub directory to Masked Domain C#.Net

Posted on 2009-04-10
4
670 Views
Last Modified: 2013-12-17
Hi all,

Okay so I have a domain name hosted with fasthosts, I'm not cash positive at the moment so I'm hosting the website on my home computer for development purposes etc. I got the email and web forwarding package for £15pa which allows me to forward my domain name and mask it.

Here's my setup:

Domain on fasthosts: "www.mydomain.com" > Points to > "myname.dyndns.org" which in turn points to my IP Address and is updated by my router.

This works fine, however in IE if I go to www.mydomain.com just as in FF the address bar contains only the domain name regardless of which sub directory i may be in. And in the status bar I can see the proper URL "myname.dyndns.org" when I navigate around the site.

In IE if I try to post a form it won't go through, now the address in IE is still just "www.mydomain.com" but if I change it to say: www.mydomain.com/form/directory/theform.aspx everything works fine and the form goes through.

So my question is:

When I retrieve the URL as in HttpContext.Current.Request.URL.Host I get "myname.dyndns.org" and HttpContext.Current.Request.URLReferrer.Host I get "www.mydomain.com"

So is there any way to say append the orginal sub directory from the root that we're in to the URLReferrer, something like:

URL Referrer Currently:   www.mydomain.com
Actual URL:  myname.dyndns.org/dir/form.aspx

Appended Referrer: www.mydomain.com/dir/form.aspx

As I believe then everything would work fine.

I'm sorry if anyone finds me difficult to follow, I'm not very good at explaining things.

Thanks for the help in advance

Craig

PS: I tried setting up BIND 9 to resolve my domain name issue but you have to get registered as a nameserver with your host and everything plus I'm on a dynamic IP. But if anyone has had any experience with BIND, nameserver and dynamic IP setup any pointers would be appreciated.
0
Comment
Question by:Newt6398
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
oobayly earned 500 total points
ID: 24121532
It's been a while since I've set up a web-forwarding domain with Fasthosts, but I'm not quite following your setup.

Ideally, you should have your a CNAME record for www.mydomain.com pointing to mydomain.dynds.org, which is updated by your router.
This way the browser doesn't even know about the dyndns.org domain, as it's only used for resolving the IP. Hence your ASP.Net site would only be concerned with one Host header, www.mydomain.com, and any of the resulting problems should be there anymore.

Personally I'd recommend createing a ZoneEdit account, change the NameServer records for your domain to point to ZoneEdit's ones. Then in ZoneEdit, add a CNAME record that points to mydomain.dyndns.org

The only thing I'll say is, have a good look at your current MX records, so that they can be duplicated when you set up a ZoneEdit account.

This is the way google do theirs, you never see your browser mentioning www.l.google.com
dig +short -t cname www.google.com
www.l.google.com.

dig +short  www.l.google.com
209.85.229.99
209.85.229.103
209.85.229.147
209.85.229.104
0
 
LVL 1

Author Comment

by:Newt6398
ID: 24123535
On zone edit I can only create a numeric A record so I can't point to myname.dyndns.com. So i'm still stuck with web forwarding using a cloaked address.

There must be a way to detect in my Global.aspx the cloaked domain name and then append the sub directory to it.
0
 
LVL 1

Author Comment

by:Newt6398
ID: 24124407
oobayly, thanks, you are absolutely right, I had a redirect going on from my default site in IIS which I totally fogot about. This was causing issues.

Thanks anyhow.
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24124954
Thanks for the points, I'd written another reply,  but somehow left it in a tab and forgot to submit it.

Anyhow, if you ever need to rewrite url, you can use HttpContext.Current.RewritePath() in the Application_BeginRequest event (you may of course know about the one).
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now