I have my Default Web Site setup in IIS with two branches under it
Default Web Site
- Site 1
- Site 2
When I open Site 2 as localhost/Site2 it redirects to localhost/randomText/Site2
and can obviously not find Site2
The requested URL is shown as /randomText/Site2
How can make localhost go to localhost/Site2?
FYI this was working till yesterday suddenly this changed.
Related
I have an site, let's call it 'foo'.
I wanna have three contents.
1 site will be the landing page.
1 site will be contentA.
1 site will be contentB.
The domains must be:
foo.com (with landingpage)
content1.foo.com (with content1)
content2.foo.com (with content2)
All sites are a big project on firebase.
But when i deploy i cannot set target to subdomain (which is already configured).
How can configure this setup ? I want 3 contents on same domain, all hosted by firebase.
I'm using ASP.NET Friendly URLs in my web application project.
It works without any problem, but when I use IIS and Create Application under my default web site I get 404 error.
For example I have a page with URL address like this:
localhost/home/default.aspx
and I rewrite it to this address:
localhost/home/
with this line in routeconfig.cs:
routes.MapPageRoute("home", "home", "~/home/Default.aspx")
I refer to this new URL in my link by href="/home" and as I said it works ok until I use the application under IIS.
I created the application under my default web site in IIS with name APP1 and when I click on link with href="/home" my page address must be localhost/APP1/home but the address in address bar changes to localhost/home and I get 404 error.
Could you help me solve this problem?
The home page will not be localhost/app1/home - that's not how it works.
1 - Create an entry in your hosts file: -
127.0.0.1 app1
2 - Create a new website in IIS, pointing at the root folder of your website. Make sure you enter 'app1' into the 'Host name' field: -
3 - The home page of your new site is http://app1/home
In our IIS server we created 3 websites, so under the folder Sites we have Default Web Site, Site1, Site 2. under Default Web Site we have many many applications and one of these applications called "Main"
Also we have 1 domain name like "http://www.ourdomain.com"
How can I do the following
If the user wrote http://www.ourdomain.com or http://www.ourdomain.com/main, then redirect to Default Web
Site/Main
If the user wrote http://www.ourdomain.com/Site1, then to show the content of Site1 and not an application inside the Default Web Site
If the user wrote http://www.ourdomain.com/Site2, then to show the content of Site2
Our Admin he used the HTTP Redirect and he put the url http://www.ourdomain.com/main so everything is redirecting to main
Also, is it possible to use this configuration site1.ourdomain.com instead of http://www.ourdomain.com/site1 ? and how if yes?
Forgive me for my question, I have no experience about how to work on these things in IIS
Option 1
To get site1.ourdomain.com you just need to set the host header in IIS to use this subdomain. Right click the site in IIS, click "Edit Bindings", either add or edit an existing binding to use the subdomain. I would strongly recommend against having three separate sites in IIS if those sites are subsites.
Option 2
Your other option would be to make the subsites areas in MVC in one project.
I currently have a couple of websites setup on an IIS Server. I have setup the Host Headers correctly but whilst testing using the Hosts file (By adding in the URL and public IP address) - it displays the default IIS Start page instead of the actual website, this is the case for all of the websites added to the IIS Server.
Any help would be great.
Many thanks.
I've just opened a Web Site project found on my predecessor's machine and - I hate the things and don't ever work with them - I get a 404 on every link I click, while the page is definitely present. If I directly view the individual page in the browser, that page works fine, except for any links on it to other pages.
It's like the built-in dev web server isn't operating and interpreting URL requests, but I have no idea where to look to clear this up.
USING IIS: If I create and deploy this site under IIS, everything seems to work normally.
MY MAIN QUESTION IS: Why do pages get not get served on this site and do get served on similar sites, under debugging a Web Site project on VS2012. It is not how to solve the problem by deploying to IIS.