I would just like to know how to configure Azure for it to load my practice website properly. I found a tutorial and downloaded the file at http://www.angularcode.com/demo-of-a-simple-crud-restful-php-service-used-with-angularjs-and-mysql/. I have tried this Restful files in my localhost and it works just fine however when I upload the files to Azure using Transmit it does not load and returns angular.min.js:72 GET https://ptamob.azurewebsites.net/services/customers 404 (Not Found). I have tried to upload the same set of files to hostinger.ph and it works. I would like to know how to fix this this and also the difference why its loading in hostinger and not in Azure. Thank you.
According to the tuturial, I think the issue was caused by the configuration for url rewrite rules on the http server. Azure support the feature of url rewrite rules via Azure IIS server, not Apache http server.
So the url rewrite rule configuration for Apache http server need to be translated for IIS server.
You can try to access the Kudu console for your webapp via the url https://<your-webapp-name>.scm.azurewebsites.net/DebugConsole
and configure the Web.config
file at the path D:\home\site\wwwroot
.
The rewrite rule configuration for web.config
like this as below.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Please refer to the section Configure the URL rewrite
of the doc "Azure : Create an URL Rewrite Azure Web App".