0
的.htaccess RewriteBase這是我的.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代碼中的任何問題?
只需添加這只是下面的'
'您網頁的HTML部分:'但我發現這不是最佳做法,因爲我們需要在測試生產服務器中再次更改它。 – anilCSE
然後保持開發,測試,產品完全相同的目錄結構。重寫規則或.htaccess不會導致這種情況,它是在'src =「...」'中引起它的相對路徑的使用。 – anubhava