By default, SolidCP sets default.htm page as the default document of your website. If you want to set your own default page, something like index.php or default.aspx, you can set it from the SolidCP itself.
Let's see the steps to setup default document from the SolidCP.
- Login to SolidCP. SolidCP is located at URL http://your-vps-ip:9001.
- Once you are logged into SolidCP, click on All Customers link.
- In the next screen, you will see the list of all created users. If you have not created any user yet, you'll see the default admin user there. Click the username link under website is created.
- In the next screen, you will see icons for all the services you can manage from the SolidCP. Select Web & Applications section and click Web Sites icon.
- In the next screen, you will see the list of previously created websites. Select the website whose default document you want to set.
- Under Default Documents box, you will see a list of all default documents. If your default document is in the list, you can simply bring it on top of the list. If your choice of default document is not in the list, then you can add it to the list. Once you are done with the changes, click on Save Changes & Exit button.
Follow the below steps for how to set the default page IIS Manager
1. Open the IIS
Go to run window and type “inetmgr” and hit enter to open IIS web server in your windows system.
2. Select Default Document Option
Now go under sites option in left side bar and select your site. Now click on “Default Document” option.
3. Enter Default Page Name
Now you will show a list of pages which is globally set as default document for your website.
Now click on Add button in right sidebar.
It will show a pop-up. Enter your filename to set as default document and click OK.
4. Set Top in Priority Order
Now Select your new filename entered and put it at top of priority order by using “Move Up” button in actions side bar.
Now your default document has been correctly configured for your website in IIS web server.
Follow the below steps for How to Set Default Page Using Web.Config
1. The web.config file is located at \wwwroot\web.config. While it's possible to have multiple configuration files, there is usually only one in the root directory.
2. First you need to look for <system.webServer> in your Web.Config file, if it is missing then you will need to add it. After that you need to add the <defaultDocument> section as shown below. And within it between the <files> section you can add either single page or multiple pages.
3. If you prefer to set a single default page, include the code as shown in the image below.
<defaultDocument enabled="true">
<files>
<clear/>
<add value="Home.html"/>
</files>
</defaultDocument>
4. If you wish to designate multiple default pages for your website, insert the code as illustrated in the image below.
The following elements are used to set the default page in the web.config file.
<assemblyBinding> | Specifies assembly binding policy at the configuration level. |
<startup> Settings Schema | All elements in the startup settings schema. |
<runtime> Settings Schema | All elements in the runtime settings schema. |
<system.runtime.remoting> Settings Schema | All elements in the remoting settings schema. |
<system.Net> Settings Schema | All elements in the network settings schema. |
<cryptographySettings> Settings Schema | All elements in the crypto settings schema. |
<configuration> Sections Schema | All elements in the configuration section settings schema. |
Trace and Debug Settings Schema | All elements in the trace and debug settings schema. |
ASP.NET Configuration Settings Schema | All elements in the ASP.NET configuration schema, which includes elements for configuring ASP.NET Web sites and applications. Used in Web.config files. |
<webServices> Settings Schema | All elements in the Web services settings schema. |
Web Settings Schema | All elements in the Web settings schema, which includes elements for configuring how ASP.NET works with a host application such as IIS. Used in aspnet.config files. |
Note :: Each configuration file must contain exactly one <configuration> element.
Conclusion
In conclusion, this guide has explored the diverse methods of setting the default page for a website through SolidCP, IIS Manager, and the web.config file.
Whether opting for the user-friendly interface of SolidCP, the feature-rich IIS Manager, or the code-level customization offered by the web.config file, users can efficiently manage their default pages to enhance website accessibility.
By understanding the distinct processes involved in each method, individuals can choose the approach that best suits their preferences and server management needs.