2017-05-10 9 views
0

私のCakePHP v2.2アプリをLinuxサーバからAzure App Serviceにコピーしてdev/testingしました。私は.htaccessが動作しないので、各フォルダにweb.configを追加しました。\ & \app\ & \app\webroot\サイトのルートが動作し、ホームページがロードされ、データフォームSQL、CSSおよびJSロードが読み込まれます。 CSSファイルは\app\webroot\cssでホストされていますが、example.com\css\file.cssでアクセスされるため、何らかの書き換えが機能していると仮定します。CakePHPをAzure App Serviceに移動しましたが、書き換えが機能しません。

ページに行き、すなわちexample.com/about、私はエラーにThe resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

を取得し、私が見た中で最もいない場合はIIS上でこれをホスティングについて、ここでのすべての投稿をして、そして再び私は私のweb.configsを考えるとき、問題がありますある。私は何が欠けていますか? \app\webroot\

​​0で \app\

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.web> 
     <customErrors mode="Off"/> 
    </system.web> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="rule 1A" stopProcessing="true"> 
        <match url="^$" /> 
        <action type="Rewrite" url="webroot/" /> 
       </rule> 
       <rule name="rule 2A" stopProcessing="true"> 
        <match url="(.*)" /> 
        <action type="Rewrite" url="webroot/{R:1}" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

のweb.configで\

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="rule1A" stopProcessing="true"> 
        <match url="^$" /> 
        <action type="Rewrite" url="app/webroot/" /> 
       </rule> 
       <rule name="rule2A" stopProcessing="true"> 
        <match url="(.*)" ignoreCase="false" /> 
        <action type="Rewrite" url="app/webroot/{R:1}" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

のweb.configで

のweb.config

答えて

0

修正済み!この記事を再度検索し、web.configを\に更新し、他の2か所からweb.configsを削除しました。魅力的な作品!

https://book.cakephp.org/2.0/en/installation/url-rewriting.html#url-rewrites-on-iis7-windows-hosts

\

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="Rewrite requests to test.php" 
        stopProcessing="true"> 
        <match url="^test.php(.*)$" ignoreCase="false" /> 
        <action type="Rewrite" url="app/webroot/test.php{R:1}" /> 
       </rule> 
       <rule name="Exclude direct access to app/webroot/*" 
        stopProcessing="true"> 
        <match url="^app/webroot/(.*)$" ignoreCase="false" /> 
        <action type="None" /> 
       </rule> 
       <rule name="Rewrite routed access to assets(img, css, files, js, favicon)" 
        stopProcessing="true"> 
        <match url="^(img|css|files|js|favicon.ico)(.*)$" /> 
        <action type="Rewrite" url="app/webroot/{R:1}{R:2}" 
         appendQueryString="false" /> 
       </rule> 
       <rule name="Rewrite requested file/folder to index.php" 
        stopProcessing="true"> 
        <match url="^(.*)$" ignoreCase="false" /> 
        <action type="Rewrite" url="index.php" 
         appendQueryString="true" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 
でweb.configファイル
関連する問題