惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

博客园 - noneisnull

USB KVM 基于docker/虚拟机的esp32远程工作流 - noneisnull - 博客园 centos 下nginx +php 环境搭建 Could not update ICEauthority file /home/username/.ICEauthority nginx 路径问题 MTK 定时器 休眠时的动作 disruptor google搜索引擎优化初学者指南-学习笔记 Can't load IA 32-bit .dll on a AMD 64-bit platform Google Protocol Buffer 的使用和原理 Create a W3C validated anchor link with target=“_blank” allegro 自动保存 Troubleshooting MySQL Memory Usage nginx http proxy 正向代理 配置电信网通双线双IP的解决办法 优酷网架构学习笔记 浅谈facebook的服务器架构 百度贴吧10亿量级LAMP架构分享 The Linux IO Stack Diagram
nginx 不带www到www域名的重定向
noneisnull · 2013-01-09 · via 博客园 - noneisnull

这里,如果是单次重定向用 redirect, 如果永久跳转用 permanent,这里用 permanent

 {

               listen       80;

               server_name  xxx.com www.xxx.com;

               index index.html index.php;

               root  /data/www/wwwroot;

               if ($http_host !~ "^www.xxx.com$") {

                       rewrite  ^(.*)    http://www.xxx.com$1 permanent;

                 }

               ........................

       }

posted @ 2013-01-09 23:08  noneisnull  阅读(12891)  评论(1)    收藏  举报

刷新页面返回顶部