Reputation: 300
I have a project coded in Laravel that works pretty good on localhost.
I uploaded it on Azure from a git repository. When I try to access the pages, I get this message:
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
I already googled the problem I am having but nothing seems to work.
EDIT:
My Azure WebApp is set to access site\wwwroot\public\ as the application.
Click here to see the picture showing what I said above
Upvotes: 1
Views: 3186
Reputation: 125
This issue can be fixed by putting the web.config file in the public folder.
https://github.com/Azure-Samples/laravel-tasks/blob/master/public/web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" 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>
</system.webServer>
</configuration>
More details on the whole process here: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-php-mysql
Upvotes: 1
Reputation: 300
As nothing I tried worked, I deleted the app on Azure and created another one. This time, it worked. I don't know why. Probably my older files was corrupted somewhere..I don't know.
Upvotes: 1
Reputation: 9940
Since Laravel uses \public
as the entry point and .htaccess
file is not recognizable by Azure Web App,
could you try setting the virtual directory to site\wwwroot\public
in Application settings via Azure portal?
Upvotes: 0
Reputation: 1038
The error suggests that the file you are looking for is not present on the server or you have not properly configured your web.config file.
If you are using any special file name i would suggest you to look through FTP that the file is present on the servers.
I would suggest you enable diagnostic logging for Web Apps to get detailed error messages and logs.
Also, check if it is a deployment or a runtime issue as described here: https://github.com/projectkudu/kudu/wiki/Deployment-vs-runtime-issues
Upvotes: 0