Deploying Laravel Applications to Windows Azure – URL Rewriting

This is just a quick one for reference purposes. You can use Laravel 4 on Windows Azure Websites, but you’ll need to rewrite the urls similarly to you would with apache. Create a file named web.config and drop it into the root of your website (or Github repository if you are deploying from there). This assumes your laravel public directory is src/public .

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <clear />
        <rule name="TransferToPublic" stopProcessing="true">
          <match url="^(app|assets|css|fonts|images|js|packages|favicon.ico)(.*)$" />
          <action type="Rewrite" url="src/public/{R:0}" />
        </rule>
        <rule name="Rewrite requested file/folder to index.php" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <action type="Rewrite" url="src/public/index.php/{R:0}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite> 
  </system.webServer>
</configuration>
22
Aug 2013
POSTED BY
POSTED IN Azure Laravel
DISCUSSION 3 Comments
TAGS