php - .htaccess file in azure app url rewriting -


i have single page application developed in php angular mysql. uses rest api class data mysql db.

application works fine in shared hosting cpanel (linux). copied files in azure app service cannot work. following message:

the page cannot displayed because internal server error has occurred.

i understand running iis , iis not support .htaccess file rewriting url .

the contents of .htaccess :

<ifmodule mod_rewrite.c> rewriteengine on  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-s rewriterule ^(.*)$ api.php?x=$1 [qsa,nc,l]  rewritecond %{request_filename} -d rewriterule ^(.*)$ api.php [qsa,nc,l]  rewritecond %{request_filename} -s rewriterule ^(.*)$ api.php [qsa,nc,l]    </ifmodule> 

if have done study , changed .htaccess web.config still not work.

my web.config :

<?xml version="1.0" encoding="utf-8"?> <configuration> <configsections>     <sectiongroup name="system.webserver">         <sectiongroup name="rewrite">             <section name="rewritemaps" overridemodedefault="allow" />             <section name="rules" overridemodedefault="allow" />         </sectiongroup>     </sectiongroup> </configsections>  <system.webserver>     <security>      </security>     <directorybrowse enabled="true" />     <caching>         <profiles>             <add extension=".php" policy="disablecache" kernelcachepolicy="disablecache" />             <add extension=".html" policy="cachefortimeperiod" kernelcachepolicy="cachefortimeperiod" duration="14:00:00:00" />         </profiles>     </caching>     <rewrite>     <rules>     <rule name="rule 1k" stopprocessing="true">         <match url="^(.*)$"  ignorecase="true" />         <action type="rewrite" url="/php/services/api.php?x={r:1}"  appendquerystring="true" />     </rule>          </rules>     </rewrite>     <defaultdocument>         <files>             <remove value="index.php" />             <add value="index.php" />         </files>     </defaultdocument>    </system.webserver> 

according content of web.config, requests rewrote php/services/api.php script under root directory. make sure there script exist in path.

additionally, according error message get, usually, when message, means there wrong code on server.

per experience, maybe miss dependencies required in php scripts. can login kudu console site of web app check application's completeness. url of kudu console site should https://<your_site_name>.scm.azurewebsites.net.

any update, please feel free let me know.


Comments

Popular posts from this blog

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

wordpress - (T_ENDFOREACH) php error -

Using django-mptt to get only the categories that have items -