Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to use Laravel in Windows IIS

Laravel 4 in Windows Server IIS

###1. Put this web.config in laravel root diretory

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
		<defaultDocument>
			<files>
				<clear />
				<add value="index.php" />
				<add value="default.aspx" />
				<add value="Default.htm" />
				<add value="Default.asp" />
				<add value="index.htm" />
				<add value="index.html" />
			</files>
		</defaultDocument>
		<handlers accessPolicy="Read, Execute, Script" />
		<rewrite>
			<rules>
				<rule name="Imported Rule 3" stopProcessing="true">
					<match url="^(.*)$" ignoreCase="false" />
					<conditions logicalGrouping="MatchAll">
						<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="public/index.php/{R:1}" />
				</rule>
			</rules>
		</rewrite>
	</system.webServer>
</configuration>

###2. Done. Don't move the public folder or any file :)

@brcontainer
Copy link

brcontainer commented Mar 13, 2016

Thanks! Work fine in IIS Express for several frameworks like Laravel and Laravel5 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment