0

これは私の .htaccess ファイルです

  RewriteEngine On

  RewriteBase /myapp_dev/

  RewriteCond %{REQUEST_URI} /index\.html$ [NC,OR]
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  RewriteRule ^(signup|signin)/?$ $1.html [L,NC]

  RewriteRule ^home/?$ signup.html [L,NC]

  RewriteRule . index.html [L]

そして、私のhtmlページには、これがあります

<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <base href="/">
</head>
<body>
  
  <!-- Something here -->
  
  
  <script src="public/libs/angular/angular.js"></script>
  <script src="public/libs/angular-resource/angular-resource.js"></script>
</body>
</html>

サーバーがリクエストすることを期待していますhttp://localhost/myapp_dev/public/libs/angular/angular.js

しかし、とにかく存在しないこのURLを要求しています。

http://localhost/public/libs/angular/angular.js

.htaccess コードに問題はありますか?

4

1 に答える 1

0

開発ホストで、サイト ルートに新しい .htaccess を作成し、これらの静的パスを処理する追加のルールを設定します。

RewriteEngine On

RewriteRule ^public/libs/.+$ /myapp_dev/$0 [L,NC,R=301,NE]
于 2016-08-24T11:38:35.447 に答える