我在虚拟主机(Apache)中安装了wordpress。安装和设置就像一个魅力。我可以毫无问题地访问wp-login.php,我可以在wp-admin /内容中执行所有操作但是当我尝试访问该站点时,有一个重定向,到目前为止我无法弄清楚:
我的虚拟主机配置:
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#Default site
<VirtualHost *:80>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin mail@mail.com
DocumentRoot /var/www/vhosts/wp/html
ServerName wp.domain.net
ServerAlias wp.domain.net
ErrorLog logs/wp.domain.net-error_log
CustomLog logs/wp.domain.net-access_log common
</VirtualHost>
在WP中我只安装了一个主题,没有进行其他修改。
/ var / www / vhosts / wp / html包含WP文件(index.php,wp-config.php等)
这是我使用chrome获得的重定向:
Remote Address:192.168.56.21:80
Request URL:http://wp.domain.net/
Request Method:GET
Status Code:301 Moved Permanently
Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Cookie:wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_24f5535023d725030a9c017d40513418=wp_domain%7C1401501745%7C842283928c4bd862a05205e18d9b6314; wp-settings-time-1=1401328965
DNT:1
Host:wp.domain.net
Pragma:no-cache
Proxy-Connection:keep-alive
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36
Response Headers
Content-Encoding:gzip
Content-Length:20
Content-Type:text/html; charset=UTF-8
Date:Thu, 29 May 2014 02:10:49 GMT
Location:http://wp.domain.nethttp/wp.domain.net/
Server:Apache
Vary:Accept-Encoding
X-Pingback:http://wp.domain.net/xmlrpc.php
正如您所看到的,响应中的Location:http://wp.domain.nethttp/wp.domain.net/
具有两次网站的路径
我错过了什么?我没有触摸.htaccess,就像在tar文件中一样
先谢谢你的帮助......
添加.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