• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

Appending sub directory to Masked Domain C#.Net

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
Newt6398
Asked:
Newt6398
  • 2
  • 2
1 Solution
 
oobaylyCommented:
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
 
Newt6398Author Commented:
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
 
Newt6398Author Commented:
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
 
oobaylyCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now