我正在configuration一个在apache下工作的WordPress的网站,我已经转到了nginx。 该网站是公司活动的独立部分,即“交易为”。 母公司是KJT Investments Ltd,交易人是KJT Aviation。
该网站是KJT航空公司和母公司的DNS点在服务器的IP地址服务kjtaviation.com。 这两个站点都从同一个服务器和IP地址提供服务。
在Apache下,redirect在.htaccess中
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
我为kjtaviation.com创build了如下的服务器文件
server { listen 95.154.237.186:80; root /var/www/kjtaviation; index index.php ; # Make site accessible from http://kjtaviation.com/ server_name www.kjtaviation.com kjtaviation.com; access_log /var/log/nginx/kjtaviation.com-access.log; error_log /var/log/nginx/kjtaviation.com-error.log; location / { #try_files $uri $uri/ =404; # PWI 20151112 from here... # https://wordpress.org/support/topic/permalinks-nginx-not-working-help-required try_files $uri $uri/ /index.php?$args; } error_page 404 /404.html; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # With php5-cgi alone: #fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } }
我已经创build了另一个服务器文件的redirect…
server { listen 80; #implemented by default, change if you need different ip or port server_name www.kjtinvestments.co.uk kjtinvestments.co.uk ; access_log /var/log/nginx/kjtinvestments.co.uk.access.log; error_log /var/log/nginx/kjtinvestments.co.uk.error.log; rewrite_log on; return 301 $scheme://www.kjtaviation.com$request_uri; } root@srv:/var/www/kjtaviation#
这些文件从站点链接 – 可用于站点启用。
到目前为止这么好 – kjtaviation网站的作品,和CURL报告,redirectkjtinvestments.co.uk正在工作…
srv# curl -I http://www.kjtinvestments.co.uk/ HTTP/1.1 301 Moved Permanently Server: nginx/1.2.1 Date: Fri, 13 Nov 2015 14:27:35 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/5.4.45-0+deb7u2 X-Pingback: http://www.kjtaviation.com/xmlrpc.php Set-Cookie: PHPSESSID=4dvkba202vic8ajv6l0hdntjd5; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: http://www.kjtaviation.com/
问题是,该网站不会出现,如果你去哟http://www.kjtinvestments.co.uk ,我不明白为什么。
如果有人指出我的错误/遗漏或愚蠢,我将非常感激;-)。