How can I set the default page for an https request?

6,384

Solution 1

Scott Forsyth - MVP's answer to 'Different file locations for http v https on IIS?' suggests that you look at Failed Request Tracing to help identify the fault, I'd also suggest checking the IIS logs to see exactly what is happening to the request for default.aspx, it must be going somewhere!

Solution 2

I think you have to enable https in IIS itself. The following links will help

http://support.microsoft.com/?id=324069

http://support.microsoft.com/?id=298805

Solution 3

It sounds as though you will need to set up default documents for the secure site, as described in Setting Up Default Documents from the IIS 6.0 documentation:

  1. In IIS Manager, double-click the local computer, right-click the Web Sites folder or an individual Web site folder, and then click Properties.

Note: Configuration settings made at the Web Sites level are inherited by all of the Web sites on the server. You can override inheritance by configuring the individual site or site element.

  1. Click the Documents tab.

  2. Select the Enable default content page check box.

  3. Click Add to add a new default document to the list.

Solution 4

The easy way to redirect could possibly lie in doing a 301 from your option 2 & 3 listed above.

In essence make a default page that the user lands on and set that to automatically redirect to the desired page?

Share:
6,384

Related videos on Youtube

Stian Fauskanger
Author by

Stian Fauskanger

"The three chief virtues of a programmer are: Laziness, Impatience and Hubris." - Larry Wall Laziness: I'm too lazy to do the same task repeatedly so write scripts to do that task for me. This makes people think I am intelligent. Impatience: I'm too impatient to wait for my code to run so rewrite the code to improve performance. This makes people think I am a good programmer. Hubris: When someone asks if I can do something I just say Yes, then go find out how to do it (Google!). This makes people think I can do anything. Ultimately, it means I can make a career out of being Lazy, Impatient, and Hubristic(?).

Updated on September 18, 2022

Comments

  • Stian Fauskanger
    Stian Fauskanger about 1 year

    We have a website which has a Virtual Directory containing the secure portion of the website.

    If users come to http://www.mydomain.com, they should get directed to default.aspx of the main site, but if they go to https://www.mydomain.com, they should go to default.aspx of the virtual directory.

    The default page for the main site works fine, as does the secure page if I navigate to it using the full name, however I can't figure out how to set the default page for https traffic that doesn't specify a specific page.

    1. http://www.mydomain.com - Works
    2. https://www.mydomain.com - Page Not Found
    3. https://www.mydomain.com/myvirtualdirectory - Page Not Found
    4. https://www.mydomain.com/myvirtualdirectory/default.aspx - Works

    What do I need to do to make links 2 and 3 load the default page show in 4?

    My website is running on IIS 6.0 in Windows Server 2003

  • Stian Fauskanger
    Stian Fauskanger over 11 years
    It is enabled.... I want to know how to set the default page for it though because right now I have to manually type in the page name to access it. For example, https://www.mydomain.com returns a Page Not Found, however https://www.mydomain.com/default.aspx will load correctly
  • toomanyairmiles
    toomanyairmiles over 11 years
    @Rachel have you looked at this serverFault question, the circumstances sound very similar to yours... The second answer has some helpful tips on tracing the source of the error
  • toomanyairmiles
    toomanyairmiles over 11 years
  • Stian Fauskanger
    Stian Fauskanger over 11 years
    @toomanyairmiles I am not sure how those links are supposed to help. I have SSL setup correctly, and it works - IF I use the full path name of the page I am trying to reach. I want to know how to make https://mydomain.com/mysecurevirtualdirectory display the Default.aspx page for the virtual directory instead of a 404 Not Found error.
  • toomanyairmiles
    toomanyairmiles over 11 years
    @Rachel if you read the answers to both questions they may give you some clues on how to debug this, particularly the answer from Scott Forsyth - MVP as it appears to directly address your situation.
  • Stian Fauskanger
    Stian Fauskanger over 11 years
    @toomanyairmiles Thanks, however although Scott's answer addresses the problem, the final resolution is "I can't guess what would cause this". It does provide some debugging steps, but those aren't helping me
  • toomanyairmiles
    toomanyairmiles over 11 years
    @Rachel I was hoping the debugging steps would help you figure the problem. My only other thought was caught buy LeseMajeste... There is nothing in the logs at all?
  • Stian Fauskanger
    Stian Fauskanger over 11 years
    @toomanyairmiles There is something, but I'm not very good at reading IIS logs. It lists 4 files: default.aspx:80 - status 200, css style sheet over port 80 - status 304, index.php/myvirtualdirectory:443 - 404 0 3, and favicon.ico:443 - 404 0 2. The top default page listed is default.aspx, so I'm not sure why it's looking for index.php...
  • toomanyairmiles
    toomanyairmiles over 11 years
    @Rachel answer posted. Glad you got your error fixed.
  • Stian Fauskanger
    Stian Fauskanger over 11 years
    Thank you, the issue was with an unrelated website hosted on a different IP address on the same machine which is rewriting URLs that didn't have a default page specified to add index.php to it. I would have never found this without the IIS error logs.