Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set web.config default page for php index file

I'm trying to start my web site on iis server and I use php for that.

every thing is fine on server but defaultDocument.

how can I set that on web.config file.

  <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument enabled="true">
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="index.php" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

this is the default xml and I try other thing like:

<clear />

or try to remove other pages...

any Idea how can I set this file?

like image 243
Pooya Avatar asked May 13 '13 12:05

Pooya


People also ask

How to change default index page in Apache server?

You can change default index page via Apache Server configuration file, or using .htaccess file. We will look at both approaches below. Apache configuration file is present at one of the following locations depending on your installation: Open terminal and run the following command to open Apache configuration file

How to add multiple index pages to Apache web server?

You can also add multiple index pages to Apache as shown below <IfModule dir_module> DirectoryIndex home.html welcome.html </IfModule> Restart Apache web server to apply changes. You can also change default index page for Apache using .htaccess. Before proceeding, please enable mod_rewrite (.htaccess) in your Apache web server.

What is the web config file?

The web.config is a file that is read by IIS and the ASP.NET Core Module to configure an app hosted with IIS. In order to set up the ASP.NET Core Module correctly, the web.config file must be present at the content root path (typically the app base path) of the deployed app. This is the same location as the website physical path provided to IIS.

How do I add an index page to a WordPress website?

Head to .htaccess and right-click to Edit. Paste the following code at the top of the file to configure your desired index page: Remember to replace example.html with the page you want to use. You can also list more than one file in the configuration. In this example, we add first.html, index.html, and index.php to the list.


1 Answers

after some more researches, the only suitable config was this...

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.html" />
                <add value="index.htm" />
            </files>
        </defaultDocument>
    </system.webServer>
    <system.data>
        <DbProviderFactories>
            <remove invariant="System.Data.SqlServerCe.4.0" />
            <add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </DbProviderFactories>
    </system.data>
</configuration>
like image 166
Pooya Avatar answered Sep 28 '22 06:09

Pooya