Solved

Appending sub directory to Masked Domain C#.Net

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
transition to visual .net from vb6 5 64
Regarding swagger API 1 39
orderby list (from Json) 1 32
vb.net application has warrnings about VB6 calls. 2 20
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

696 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