Skip to content

Instantly share code, notes, and snippets.

@leabdalla
Created August 1, 2013 21:43
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save leabdalla/6135627 to your computer and use it in GitHub Desktop.
Save leabdalla/6135627 to your computer and use it in GitHub Desktop.
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

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