imitate iframe coming from another domain - iframe

I am trying to develop a small web application which will consist of one web applicaiton using an iframe from another domain. I am trying to test this on my local machine, and for this I need to imitate as if the iframe is coming from another domain (while it's actually on the same domin as the other web application - my computer). Can this be done? If so, how?
Thank you

Test it through a local http server (just in case your were accesing to the local files).
Define 2 different vhosts in your http server.
Edit your etc/hosts file to add:
127.0.0.1 domain1.com
127.0.0.1 domain2.com
So now you have 2 different sites, but running on the same computer.

Related

Multiple websites under a folder in IIS

I have a problem with websites in IIS.
The first thing that I did was that I set basic .html website in IIS under Default website (port 80). I moved the code in C:\inetpub\wwwroot\Test and it works.
When I type in the browser localhost/Test, it works but I have an ASP.NET Core web app and I want to open it using localhost/MyAspNetSite in the browser. Is this possible???
I'm asking that because when I right click on the Default website I have no possibility to add new website, only virtual directory or application. In my case, I put my .net code in C:\inetpub\wwwroot\New and in I added the new website on port 5000 and it works like localhost:5000 but not like localhost/New. I hope that you understand me.
Is it possible to have two websites on the same port or to connect two websites or something like that?
I am sending image about this problem. Thank you
You can host multiple sites under the same IP Address. In this case, the IP Address is called "Shared IP Address". This concept is used by all the shared host providers in this world.
That you basically need to do is to go to your IIS -> click your domain -> Bindings -> and add "www.yourDomain.com" and "YourDomain.com" to the IP. If you have a second site, you just have to do exactly the same thing, you can check this blog post it can help u to understand all that things
http://woshub.com/run-multiple-websites-on-the-same-port-and-ip-address-on-iis/

Applying SSL on the localhost

I am applying SSL in my sample web application using self signed certificate. The purpose is to test the session availability when I go from http to https or the other way round.
My localhost address is localhost:5366. I have done these as follows:
I have added a website in IIS. But confused that when binding using http, I give port 5366. I works fine but when I remove it and apply https, port 5366. The page doesnot load.
So, what should I do to accomplish this?
Its a bit confusing, but if i can bet, you are interchanging the debug mode from VS and the published site, correct me if am wrong.
I configured my https site in this way:
Configure your IIS to accept https through port 443.
Set the website file system place to a certain folder
Publish your website with VS to this folder
Reach it through https://localhost
Hope it works!
My project was not residing in the iis physical path. Therefore, it was not loading my desired pages. Thank you guys.

My documents target - how can i change it to open my web site

I have created a web site that ( for local use on my computer ) that navigates through the files in the My documents folder via regular links .I would like to change the way my documents folder opens now in such way that if I double click on My documents folder I would like my web to come up and use it as interface .Is there a way to do this ?
Thank you
Adrian
Maybe its lack of knowledge on web technologies and browsers.
I am really unsure of the reasons of taking this route - you could try :
<a href=file://///SERVER/folder/file.extension>LAN FILE</a>
but to be honest i am unsure why you can not run a web server on the machine that you wish to serve the pages.
So lets say you have a lan of 3 machines
10.0.0.1
10.0.0.2
10.0.0.3
You wish to use 10.0.0.1 as the master which servers the pages - install apache web server or IIS if its windows then put a page in the DocumentRoot which points to
<a href=/somefolder>Some folder</a>
where this /somefolder is a folder within the document root of the default site.
you can then go to the browser on any other LAN hit
http:// 10.0.0.1 and it will show that page with the link which is then viewable on local browser of the remote machines... files being served from 10.0.0.1
You could go a step further and look into internal DNS or hacking the local hosts file on the remaining machine and pointing an entry like
10.0.0.1 intranet
so when any of the machines hit http:// intranet - they hit 10.0.0.1

Setting up asp.net test server

I am creating a website in asp.net MVC 4 and am wondering the best way to set up a test server?
I am doing this from home and would like a way for my friend to test my code from a different location (his home). What would the best way to go about this? Build a local server that he only has access to? VMWare? Online web hosting?
One solution would be to use a VM and set up a server.
NOTE! that this would require your friend to redirect your IP Adress to the host name you will set for your website on the IIS of your VM.
He can easily do that by changing his Hosts at C:\Windows\System32\drivers\etc
Another option would be actually to purchase a domain (that you will need anyway eventually)
The purchase a hosting package (that you will also need anyway eventually).
Then setup your website on a sub domain in that hosting server e.g. dev.myDomain.com

Local testing for sub-domains using Url rewriter, Asp.Net 2

I am using UrlRewriting.Net for url rewriting in Asp.Net 2 and IIS 5.1 (offline) and IIS 6 (online)
The application performs the following:
A url of the following nature: http://username.site.com is re-written as
http://site.com/Default.aspx?user=username
This works perfectly online. However, I would like to know how we could test this offline.
I have tried pointing the application to 127.0.0.1 via IIS and then putting username.site.com in the hosts file to point to 127.0.0.1 - but it does not work out.
The website loads up - but the querystring is not generated.
Also tried putting just site.com -> 127.0.0.1 in the hosts file and accessing username.site.com. But in this case, the website does not load (site not found)
Any ideas?
easy way to test this will be to edit your hosts file so that username.site.com points to 127.0.0.1, but you will have to do this for each user you want to test on each PC...
Okay.
I managed to get this working. Its simple if you think about it.
I got myself a DNS server, installed it on my system and configured it to serve me pages from 127.0.0.1 for site.com
If you are wondering, I used a DNS server called SimpleDNS from http://www.simpledns.com/
There is also a free BIND DNS server available from:
http://oldwww.isc.org/sw/bind/view/?release=9.6.1b1&noframes=1
But that was too much for me to configure at this point of time.

Resources