Opened 13 years ago
Closed 11 years ago
#18988 closed defect (bug) (invalid)
On install, IIS web.config missing setting for "index.php" as default page type
Reported by: | scdetailer | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2.1 |
Component: | IIS | Keywords: | |
Focuses: | Cc: |
Description
If WordPress is installed in the root directory (e.g., www.example.com) on a server not pre-configured for PHP, "index.php" will not be a default page name on the server. This leads to 404 errors when requesting the homepage (e.g., www.example.com).
A simple fix is to update the web.config for the WordPress install to add this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Change History (5)
#2
@
13 years ago
I agree that possibilities are endless. But now you have a broken, non-functioning site by default for the less-technical crowd installing to a new website. The blogs/forums about this often implement poor solutions to "fix" this. Your call.
#3
@
13 years ago
- Component changed from Upgrade/Install to IIS
- Keywords reporter-feedback removed
This sounds like a bug to me. Asking ruslany to look.
#4
@
13 years ago
While it is possible to get into this situation, the likelihood of that is quite small. PHP on Windows is mostly installed by using either PHP Installer or Web Platform Installer. Both of those add index.php to the list of the IIS default documents. The only ways to get this error is if somebody installs PHP manually on Windows and forgets to add index.php to the list of IIS default documents. So my first reaction is that it is probably not that important to fix this.
However, if it is considered as an important bug then the possible fix I can think of is to include web.config file in the wordpress zip package and have the following xml in it.
<configuration> <system.webServer> <defaultDocument> <files> <remove value="index.php" /> <add value="index.php" /> </files> </defaultDocument> </system.webServer> </configuration>
Note that it is important to have <remove> first in order not to add a duplicate entry to the collection if server admin already added index.php on a server level.
I don't think that this is a bug. You have to consider the fact that an Admin might want to have another file as the default page. Let me just give you a few examples.
1) You want to have a splash page.
2) You want to use ASP.NET for authentication in front of WordPress