1.简略
我找不到如何禁用一些带有md和html扩展名的文件。
2.细节
我用鹈鹕写文章,用标记标记。例如,。我需要有两个文件在我的网站根目录:404.md和404.html。我在我的content文件夹→中创建了这些文件,运行pelican content命令,得到输出。
D:\Kristinita>pelican content
WARNING: Meta tag in file D:\Kristinita\content\404.html does not have a 'name' attribute, skipping. Attributes: http-equ
我正在研究处理来自api调用的404请求,当它运行时,我将返回html。
$http.get('/api/house/' + $routeParams.id)
.then(function (res) {
$scope.houses = res.data;
}, function (err) {
//when not found I am binding html from response
if(err.status == 404){
$scope.errHtml = $sce.trustAsHtml(err.data)
我在一个操作中有以下代码:
render :file => 'public/404.html' and return
这在浏览器中工作得很好。我已经编写了以下rspec示例来测试这一点:
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
运行此示例将导致以下错误:
Failure/Error: response.should render_template('public/404.html&
我为我的移动应用程序定义了几条路线,还有一条全是404的路由:
$r->any('*')->to(cb => sub {
my $self = shift;
$self->render(text => '404 Not Found');
$self->rendered(404);
});
404路线运行良好:
$ ./bin/myapp.pl -m production get /no_such_url
404 Not Found
但我也希望404路由与网站根目录相匹配,而且我总是得到一些默认的Mojo
我有一个在debian上运行apache2的虚拟服务器。我想在apache2.conf中为我的所有网站创建一个默认的404错误消息。
ErrorDocument 404 "/var/www/site/public/404.html"
重新启动apache后遇到的错误是:Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
虽然我不希望页面重定向,但如果我输入URL,它就能工作,只使用默认的404.html页面。
当我在本地运行它时,这段代码工作得很好,但是当我把它放在这个柱塞()中时,我会得到以下循环404错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://run.plnkr.co/main.html
GET http://run.plnkr.co/main.html 404 (Not Found) angular.js:8521
我遗漏了什么?
我在运行npm update -g
npm ERR! code E404
npm ERR! 404 Not found : default-html-example
npm ERR! 404
npm ERR! 404 'default-html-example' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also i
好了,我已经构建了一个React应用程序,并将其部署在Nginx下。到目前为止,一切都很正常,例如,Nginx通过HTTPS为站点提供服务,尽管在我的React应用程序中,我使用了react-router-dom,并默认路由到我的自定义404页面。见下文。带有/*的那个将未处理的请求路由到我的自定义“找不到”页面。当我只在本地运行react应用程序时,整个过程运行得很好,即运行"npm run“,尽管在我将静态构建部署到我的web服务器上后,任何访问有效安全页面(登录后)或无效页面路由的尝试都只显示Nginx默认的404页面。我的Nginx配置如下..
include /etc/ngi