0

Using IIS server first time . installed wordpress on server . issues is website is not working without index.php in the url .

tries this from stackoverflow. after doing this an error 500 is showing. my webconfig file is

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

also tried to change with this

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
 <defaultDocument>
     <!-- Set the default document -->
      <files>
        <remove value="index.php" />
        <add value="index.php" />
      </files>
    </defaultDocument>
        <httpErrors errorMode="Detailed"/>
    <rewrite>
        <rules>
            <rule name="wordpress" patternSyntax="Wildcard">
                <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                <action type="Rewrite" url="index.php" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>
Community
  • 1
  • 1
Manoj Dhiman
  • 5,096
  • 6
  • 29
  • 68

1 Answers1

2

Try Use this on your web.config.

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.web>
        <customErrors mode="Off" />
        <compilation debug="true" />
    </system.web>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{R:1}" pattern="\.(gif|jpe?g|png)$" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/index.php/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    <security>
            <requestFiltering allowDoubleEscaping="true" />
     </security>
    </system.webServer>
</configuration>