linux怎么把一个域名301重定向到另外一个域名
发布网友
发布时间:2022-05-01 12:42
我来回答
共1个回答
热心网友
时间:2023-10-12 22:36
server {
server_name
return 301 $scheme://domain.com$request_uri;
}
server {
server_name domain.com;
[...]
}
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/phpwind;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪静态规则
include /alidata/server/nginx/conf/rewrite/phpwind.conf;
access_log /alidata/log/nginx/access/phpwind.log;
}
转载,仅供参考。
热心网友
时间:2023-10-12 22:36
server {
server_name
return 301 $scheme://domain.com$request_uri;
}
server {
server_name domain.com;
[...]
}
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/phpwind;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪静态规则
include /alidata/server/nginx/conf/rewrite/phpwind.conf;
access_log /alidata/log/nginx/access/phpwind.log;
}
转载,仅供参考。