nginx特定的 404页面利于seo
2011-06-20 14:21
183 查看
要求:
访问http://www.qq.com/123 url保持不变 显示的结果为指定的404页面
curl -I http://www.qq.com/123 返回的状态码为404
准备一 404.php页面在最底部加上:
<?php
@header('HTTP/1.1 404 Not Found');
@header('Status: 404 Not Found');
?>
然后nginx里配置
location / {
xxxxx; ##此处表示N多的规则依据实际情况定##
rewrite ^/404.html /404.php last;
if (!-e $request_filename) {
rewrite ^(.*)$ /404.html last;
}
}
然后reload nginx即可。
访问http://www.qq.com/123 url保持不变 显示的结果为指定的404页面
curl -I http://www.qq.com/123 返回的状态码为404
准备一 404.php页面在最底部加上:
<?php
@header('HTTP/1.1 404 Not Found');
@header('Status: 404 Not Found');
?>
然后nginx里配置
location / {
xxxxx; ##此处表示N多的规则依据实际情况定##
rewrite ^/404.html /404.php last;
if (!-e $request_filename) {
rewrite ^(.*)$ /404.html last;
}
}
然后reload nginx即可。
相关文章推荐
- linux + nginx 配置自定义404页面
- nginx对特定参数限流
- phantomJS+nodeJS+nginx完美解决前后端分离SEO问题
- nginx禁止用户访问隐藏文件和.htaccess文件 .htaccess文件(或者”分布式配置文件”)提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以
- nginx网络服务器上如何阻止特定用户代理(UA)
- nginx对特定参数限流
- nginx对特定参数限流
- nginx设置404页面
- Nginx日志过滤 使用ngx_log_if不记录特定日志
- nginx反向代理到特定网站
- 【日志过滤】Nginx日志过滤 使用ngx_log_if不记录特定日志
- nginx对特定参数限流
- 用AWK来过滤nginx日志中的特定值~~~
- nginx 下 ~ seo ~ ip canonicalization 解决
- 深圳SEO:如何写网站页面的描述利于优化
- 怎样选择一个利于seo的空间
- 网页html中嵌入特殊字体-此法利于SEO
- nginx 特定目录禁止php执行
- 关于nginx开启特定路径的ssl证书验证 双向ssl
- nginx屏蔽特定http_referer的请求