How to set default homepage for subdomain on iis7? - iis-7

I've already set default homepage for "www.mydomain.com" sucessfully.
Now, I want to set default homepage for "sub.mydomain.com", but it throw 404 page if i don't type "sub.mydomain.com/default.aspx" ?
The first and the second site are separate physical folders and virtual directories on iis7.

If I have understood you correctly, you have a single web server with many sites all on port 80 and you are using host headers to control which site a request goes to.
In this case you must specify the whole address, otherwise the server does not know which site to send it to.

In IIS, default site, properties, web site, advanced, you should see a list like;
default - 80
then "Add" in these two rows
(all unassigned) : 80 : www.mydomain.com
(all unassigned) : 80 : sub.mydomain.com
then default.aspx will go to the same page in both sites. ie. sub.mydomain.com is the same as www.mydomain.com.
However, if you want sub.mydomain.com to be a different website, then remove it from that list above and from IIS, Websites -> New Website ... yadda yadda yadda, then add in sub.mydomain.com as you did above.

Related

How can I make an nginx reverse proxy to return a custom web page for different subdomains?

I want to make a web page that will be returned by nginx everytime I type a subdomain in the browser. For example, if I type exemple.com in the browser I want to see my custom web page. Also, if I will try to type any other url, the same page should be returned. How should I configure my nginx.conf file in order to do that?

iis two domain with ssl cert error browsing webpage

I have iis 10.0 which host two domains ssl cert, say 1 is www.abc.com and the another is www.dfg.com, both domain are pointing to the same iis. So I can access webpage like https://www.rgx.com/calculation.aspx and
https://www.dfg.com/calculation.aspx both. The problem is that for most page, both domain work properply, but for some webpage in one domain e.g dfg.com https://www.dfg.com/questions.aspx, it cannot be loaded, in firefox, it returns
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.
So what is the reason that some page cannot be accessed in one domain but can in another domain?
Do you have an error code? This error seems to only appear in Firefox, try the following in Firefox to see if it resolves the issue on your end:
Open about:preferences#privacy in the browser.
Scroll down to the Certificates section and click on "View certificates".
Make sure the Authorities tab is selected.
Locate Avast certificates and use the delete option to remove them.
Use the import button to import the certificates from C:\ProgramData\AVAST Software\Avast\wscert.dat.

Error 302 when the default page is changed in IIS 8

I have the following scenario. I have a website in IIS 8 and I am trying to secure it (https). I have made the web with web forms. In the process to secure it I have to change the page at the beginning (default page in the IIS administrator). When I do it, I don't get the change and I go to the website that was set by default.
I have seen the log and when trying to access the new homepage it gives an error 302 (object moved). I have seen the response header and I see that the location is configured with the old home page.
Example:
Old default page: www.namedomain.com/start.aspx
New default page: www. namedomain.com/home.aspx
The new website has as in the response header: location = /start.aspx and as I said before when trying to access it gives error 302.
Thanks.
There's a few things going on here, "securing" the site with HTTPS and also potentially <authentication mode="Forms"> in your web.config where it will try and redirect any unauthorised requests to a login page. It seems like you are just doing the HTTPS though at this stage, and maybe trying to set up a redirect from HTTP to HTTPS?
It sounds like you are also trying to change the default page for the website (in IIS or the web.config?) from default.aspx to home.aspx? I'm not sure I understand why you want to do that as it isn't necessary for HTTPS, but the effect of that will mean you can go to https://www.namedomain.com/ and you will get served the content from home.aspx instead of start.aspx (or default.aspx) but the URL will stay as just https://www.namedomain.com/
Normally to set up HTTPS, all you do is go into IIS, Bindings, and add a HTTPS binding (you'll need a TLS certificate to make the https work properly). then just make sure you include the "https://" at the start of your URL.
If you think it might be caching problem on your machine, just add a nonsense querystring to the end of your URL (like https://www.namedomain.com?blah=blahblah) and it will cause your browser to get a fresh copy of the page.
I'm not sure what is causing the 302 redirect, have you added any special code to swap HTTP requests over to HTTPS? Can you update your answer with any more info?
Yes, it is what I put in my last comment Jalpa. I do not understand very well the relationship between not configuring the session variables and the default page but once corrected in code, the application correctly loads the web by default.

how to set a domain name for an iis hosed application which is mapped to a public ip

i have an application hosted on iis in one of the local system and it is mapped with public ip. Up to now we are using this by http://public-ip/application/login.aspx it is working perfectly, now we want to assign a domain name for the above url and have to access with that domain name from the outside also. can some one suggest what i have to do further.
Thanks
A few steps:
Buy the domain from any domain registrar. I personally use namcheap.com but you can use anyone you like.
Make sure you also purchase (if not included) the DNS management service (also called nameservers).
Once domain is purchased, login to your control panel and modify the DNS record.
Add an A Record for your domain, like this, where your IP is 111.111.111.111:
yourdomain.com. IN A 111.111.111.111
(Optional) you may want to add a CNAME record (an alias) so that www.yourdomain.com also works; that record would look like this:
www CNAME yourdomain.com.
Go to IIS, and change the name of the site to the domain name.
Wait for 30 - 40 minutes for the global DNS servers to propagate the changes.
Enjoy your new site.

How to configure IIS to allow an https page being iframed within an http page within the same domain?

I have a site hosted in IIS 6.0 (I've also tested it with IIS 7.0, same result) and I've configured my page so that it only accepts iframes hosted in the same origin domain using this: http://support.microsoft.com/kb/2694329
I have added the "X-Frame-Options" field name and "SAMEORIGIN" value in the HTTP Headers tab in IIS.
That means "The page can only be displayed in a frame on the same origin as the page itself."
Now my pages can't be hosted in any other website/domain which is fine and expected.
The problem is that I have an https page whose parent is an http page both of which within the same domain. I expected this to work but I get the bellow error:
This content cannot be displayed in a frame
To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame.
What you can try:
Open this content in a new window
How to configure my site or what HTTP Header to add to allow an https page being iframed within an http page?
I also tried using "ALLOW-FROM" header name and adding specifically my domain names:
"http://mydomain.com" and "https://mydomain.com"
but it said
"The custom header already exists in the list".
So does "Origin" refer to both the domain and protocol? if so that seems to be a design issue? Or is there any workaround?
Thanks,

Resources