Nginx配置文件如下:
server {
listen 80;server_name 301.test.com;
charset utf-8;
access_log /dev/null;
error_log /dev/null;
return 301 https://www.alipay.com;
index index.php;
client_max_body_size 500m;
fastcgi_intercept_errors on;
gzip on;
if (!-e $request_filename){
rewrite ^/(.*) /index.php/$1 last;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_connect_timeout 10;
fastcgi_send_timeout 60;
fastcgi_read_timeout 60;
fastcgi_buffers 256 4k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
----------------------------------------------------------------------------
apache 配置文件:
<VirtualHost *:80>
ServerName 301.test.com
RedirectMatch Permanent ^/(.*) https://www.alipay.com/$1
</VirtualHost>