Hide path to URL files?

V

Vadivel Kumar

Asaf said:
Hello,

I have a domain URL on a shared hosting server for example www.mydomain.com
When accessing www.mydomain.com I would like to get the ASPX files from
other domain on other server for example www.otherdomain.com but I would like
the URL on the browser for all the ASPX files will always stay on
www.mydomain.com so the one who browse my website will not see for example
www.otherdoamin.com/Default.aspx

Thanks in advanced for any advice.

Regards,
Asaf

In my understanding, you want to show an aspx file that is located in
different domain, but you don't want to show that domain name while its
get requested, rather you want to show as a content that is coming from
your own domain.

Pretty possible.

1. Create an ASPX page called "another_domain_info.aspx"
2. The below is the code that goes in the .aspx file

<body>
<form id="form1" runat="server">
<div id="yahooHtml" runat="Server"></div>
</form>
</body>

3. Now, in the another_domain_info.aspx.cs file create Page_Load event
and put the below code.

protected void Page_Load(object sender, EventArgs e)
{

WebRequest w = WebRequest.Create("http://www.yahoo.com");
WebResponse wr = w.GetResponse();

StreamReader r = new StreamReader (wr.GetResponseStream());

String html = r.ReadToEnd();

HtmlGenericControl DivElement = this.FindControl("yahooHtml")
as HtmlGenericControl;
DivElement.InnerHtml = html;

r.Close();
wr.Close();
}

4. Now press F5 to execute this code. You can see yahoo's home page in
the aspx file.

Basically, what happens is WebRequest object request the given url and
gets the response coming back from the server. After getting the
response we are binding the response which is html data to the div tag
kept in the .aspx file.

Let me know in case of any issues.

-
Vadivel Kumar
http://vadivelk.net
 
W

Walter Wang [MSFT]

Hi,

Thank you for your post.

Based on my understanding, your question is how to show a page's content
from another domain. If I've misunderstood anything, please feel free to
post here.

You can use iframe to embed another page in your page, for example:

<iframe width="100%" height="100%" frameborder=no
src="http://www.msn.com"></iframe>

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Hi,

Appreciate your update and response. If you have any other questions or
concerns, please do not hesitate to contact us. It is always our pleasure
to be of assistance.

Have a nice day!

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Joined
Aug 16, 2006
Messages
1
Reaction score
0
This is so close to Asaf's question, but perhaps not so complex(?).

I have an old Perl script photo album that I want to include in a more sophisticated CMS/framework. My solution so far is to call the .cgi file from within an iFrame. Of course, when you look at the page source, you can see the URL to this file. Is there any way through ASP scripts to obfuscate this?

So, for instance, a user might see the URL to the ASP script in the browser source view, but it won't reveal the .cgi filename. If they try to run the ASP script in their browser (outside of the iFrame), it won't let them see the photo album and still won't show its URL.

I'm probably asking for something impossible, or maybe there's a much simpler way of doing this on an IIS/ASP.NET environment, but hopefully you can see what I'm trying to do.

Thanks,
- Trevor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top