web.config for Wordpress

I had to deploy a Wordpress site to a windows shared hosting server. After doing so, only the site's front page worked while the others pages were just blank.

At first I thought this might have something to do with caching. After turning caching off, deleting cache files, etc. I noticed the .htaccess file and realised that I might have to update the web.config file since I'm on Windows.

<?xml version="1.0" encoding="UTF-8"?>
    <directoryBrowse enabled="true"/>
        <add value="Default.htm"/>
        <add value="index.htm"/>
        <add value="Default.cshtml"/>
        <add value="index.php"/>
        <add value="index.html"/>
        <add value="index.pl"/>
        <add value="default.html"/>
        <add value="index.cshtml"/>
        <add value="Default.aspx"/>
      <remove fileExtension=".svg"/>
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"/>
			<rule name="wordpress" patternSyntax="Wildcard">
				<match url="*"/>
						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
				<action type="Rewrite" url="index.php"/>

Galdin Raphael

Galdin Raphael is an independent full stack developer from Mumbai.

Subscribe to Galdin's Blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!