Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eaglehdr's avatar

Laravel 9 on IIS server.

I am running laravel 9 in laragon. now I have to deploy app on IIS server. I don't have access to their server. but their guy do share screen during call. so this is we have done till now.

  • added appropriate composer, php, nodejs versions and extensions
  • cloned the project and ran composer install and npm install
  • build assets using vite run build
  • pointed document root to public folder.

but when I try to access url , the Laravel shows error, GET method is not supported for this route. supported Methods HEAD When we visited other routes, it just gave 404 error ( not laravel errors, it was IIS errors).

this is the web.config file which we converted from URL Rewrite tool from IIS

<rewrite>
  <rules>
    <!--The rule cannot be converted into an equivalent IIS format because of unsupported flags: E-->
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="(.+)/$" ignoreCase="false" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="{C:1}" />
    </rule>
    <rule name="Imported Rule 3" stopProcessing="true">
      <match url="^" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php" />
    </rule>
  </rules>
</rewrite>		
0 likes
4 replies
eaglehdr's avatar

@Tray2 I will have to forward this to that guy. they are not giving me direct access.

Tray2's avatar

@eaglehdr I would suggest that they set up a proper LEMP or LAMP stack instead, it will save you a lot of time.

eaglehdr's avatar

@Tray2 I would suggest them to move to a Linux server instead. but they are Windows user, so they have a windows 10 setup. well your helped them, they reinstalled and reconfigured URL rewrite and it worked.

1 like

Please or to participate in this conversation.