nginx 301转向+nginx伪静态设置教程
[i=s] 本帖最后由 bluegua 于 2011-11-18 16:10 编辑 [/i][b][size=4][color=red]
以下教程都是把baidu.com替换成你的域名
[/color][/size][/b]
[code]server {
listen 80;
server_name www.baidu.com;
root /www/web/baidu/public_html;
index index.html index.php index.htm;
error_page 404 /errpage/404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
include rewrite/dzx15_nginx.conf;
//伪静态文件,放在nginx的rewrite目录里,二级域名也是这样设置的
}
//以下是301转向设置
server {
server_name baidu.com;
rewrite ^/(.*)$ http://www.baidu.com$1 permanent;
}[/code] 初学者,怎么没用啊?一行一行输入运行? [b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=126&ptid=39]2#[/url] [i]山魈[/i] [/b]
修改你相关域名配置文件 版主,是修改网站根目录下的.htacccess文件吗? 学习哦,楼上的,不是修改.htacccess文件吧 学习咯。。。
页:
[1]