Solved

Appending sub directory to Masked Domain C#.Net

Posted on 2009-04-10
4
698 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

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.

Question has a verified solution.

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

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

832 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