如果一个网页开头有什么区别
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Run Code Online (Sandbox Code Playgroud)
如果页面以.开头
<!DOCTYPE html>
<html>
<head>
<!-- without X-UA-Compatible meta -->
Run Code Online (Sandbox Code Playgroud)
如果没有区别,我想我可以忽略X-UA-Compatible元头,因为我只想在所有IE版本中以大多数标准模式呈现它.
显然,整个网络上都有很多mod重写讨论和答案.但是,我很难抓住它们.所以我想我会问这里.
我要求重写规则来做Andy Joslin在评论中解释的内容:https://stackoverflow.com/a/11100438
这是我在example.com根目录下的当前dir结构
我想将所有请求重定向到app/index.html,除了对/ api的请求.
例如:
http://example.com/categories/electronics/ipod实际上就像去http://example.com/app/index.html/categories/electronics/ipod
我想隐藏app/index.html部分.
然后,对http://example.com/api的请求会有例外,因为我需要向这些url路径发出ajax请求.
感谢您提供的所有帮助/指导.
在Angular.js路由上阅读了大量的报告和stackoverflow问题之后,当我进行手动刷新时,我仍然收到"未找到"错误.
脚步:
localhost- >因为我的配置(下面),我被带到了localhost/home.视图和一切都很好.Not Found: the requested /home is not found on this server这个问题可能最像刷新页面给出"找不到页面"
我的配置
// Routing configuration.
angular.module('myModule')
.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
// Enable pushState in routes.
$locationProvider.html5Mode(true);
$routeProvider
.when('/home', {
templates: {
layout: '/views/home.html'
},
title: 'Welcome!'
})
.when('/launchpad', {
templates: {
layout: '/views/layouts/default.html',
content: '/views/partials/profile.html'
},
title: "Launchpad"
})
.otherwise({
redirectTo: '/home'
});
}
]);
Run Code Online (Sandbox Code Playgroud)
我做过的其他事情:
index.html,我已经有了<base href="/">这是我尝试过的htaccess规则.没有工作.
angularjs ×2
.htaccess ×1
apache ×1
browser ×1
html ×1
javascript ×1
mod-rewrite ×1
rewrite ×1