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