私はphp angular mySqlで開発された単一のページアプリケーションを持っています。残りのAPIクラスを使用してmysql dbからデータを取得します。紺碧のアプリでの.htaccessファイルURLの書き換え
アプリケーションは、cPanel(linux)との共有ホスティングで正常に動作します。 Azureアプリケーションサービスでファイルをコピーしましたが、動作させることができません。次のメッセージが表示されます。
内部サーバーエラーが発生したため、ページを表示できません。
IISを実行していて、IISが.htaccessファイルをサポートしていないことを理解しています。これは、URLを書き換えています。 .htaccessファイルの
内容は以下のとおりです。
いくつかの研究を行い、web.configファイルに.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>
。
私の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>
php apiアプリケーションをルートディレクトリの '/ php/services /'フォルダに入れますか? 'web.config'を削除してphp apiアプリケーションを直接ブラウズするとうまくいくでしょうか? –