Skip to content

Instantly share code, notes, and snippets.

@jatubio
Created April 29, 2015 03:49
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save jatubio/80dfc57fc18546706ec0 to your computer and use it in GitHub Desktop.
Save jatubio/80dfc57fc18546706ec0 to your computer and use it in GitHub Desktop.
IIS web.config file for Laravel 5
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Quitar los slash '/' del final de la ruta -->
<rule name="RewriteRequestsToPublic">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
<action type="Rewrite" url="/{R:0}" />
</rule>
<!-- Si el archivo o carpeta solicitado no existe, se realiza la petición a través de index.php -->
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@microdesign
Copy link

Thanks for this man, from all web.configs I try only this remove completele the index.php from the URL.

@MarFelix
Copy link

MarFelix commented Jun 6, 2019

Thanks

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