在apache2服务器上进行永久链接重定向的wordpress空白页面

时间:2018-08-14 11:26:43

标签: php wordpress apache apache2.4

我尝试将wordpress从旧服务器迁移到新的aws服务器。 我可以访问主页,但永久链接页面如下:

https://ec2-34-218-47-207.us-west-2.compute.amazonaws.com/homepage/

这是空白,里面什么也没有。

我使用admin:admin作为用户和组。

apache2.conf是:

# These need to be set in /etc/apache2/envvars
#User ${APACHE_RUN_USER}
#Group ${APACHE_RUN_GROUP}
User admin
Group admin

我更改了用户和组,因为很方便使用sftp上传和下载文件

目录为:

drwxr-xr-x  5 admin admin        4096 Aug 14 10:33 .
drwxr-xr-x  3 admin admin        4096 Jul 30 13:46 ..
-rw-r--r--  1 admin admin    32673740 Jul 31 00:37 backup
-rw-r--r--  1 admin admin    33244158 Aug  1 07:40 backup200
-rw-rw-r--  1 admin www-data     2291 Aug  2 00:24 .htaccess
-rw-r--r--  1 admin admin         470 Aug  1 14:15 .htaccess.save
-rw-r--r--  1 admin admin         418 Sep 25  2013 index.php
-rw-r--r--  1 admin admin     9503425 Jul  5 16:08 latest.zip
-rw-r--r--  1 admin admin       19935 Jan  6  2018 license.txt
-rw-r--r--  1 admin admin         181 Jul 25 01:41 phpinfo.php
-rw-r--r--  1 admin admin        7415 Aug 14 10:08 readme.html
-rw-r--r--  1 admin admin        5458 May  1 22:10 wp-activate.php
drwxr-xr-x  9 admin admin        4096 Jul 31 05:07 wp-admin
-rw-r--r--  1 admin admin         364 Dec 19  2015 wp-blog-header.php
-rw-r--r--  1 admin admin        1889 May  2 22:11 wp-comments-post.php
-rw-r--r--  1 admin admin        3111 Aug  2 00:24 wp-config.php
-rw-r--r--  1 admin admin        2853 Dec 16  2015 wp-config-sample.php
drwxr-xr-x 14 admin admin        4096 Aug 14 10:08 wp-content
-rw-r--r--  1 admin admin        3669 Aug 20  2017 wp-cron.php
drwxr-xr-x 18 admin admin       12288 Jul 31 05:09 wp-includes
-rw-r--r--  1 admin admin        2422 Nov 21  2016 wp-links-opml.php
-rw-r--r--  1 admin admin        3306 Aug 22  2017 wp-load.php
-rw-r--r--  1 admin admin       37794 Aug 14 10:08 wp-login.php
-rw-r--r--  1 admin admin        8048 Jan 11  2017 wp-mail.php
-rw-r--r--  1 admin admin       16246 Oct  4  2017 wp-settings.php
-rw-r--r--  1 admin admin       30091 Apr 29 23:10 wp-signup.php
-rw-r--r--  1 admin admin        4620 Oct 23  2017 wp-trackback.php
-rw-r--r--  1 admin admin        3065 Aug 31  2016 xmlrpc.php

我已经使用了命令行:

 a2enmod rewrite 

启用重写页面。

.htaccess是:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

我的配置错误在哪里?

我尝试更改apache2.conf 萨米尔·谢赫(Samir Sheikh)回答,但我得到了错误专家:

-- Unit apache2.service has begun starting up.
Aug 14 11:46:48 ip-172-30-0-181 apachectl[16169]: AH00526: Syntax error on line 176 of /etc/apache2/
Aug 14 11:46:48 ip-172-30-0-181 apachectl[16169]: order takes one argument, 'allow,deny', 'deny,allo
Aug 14 11:46:48 ip-172-30-0-181 apachectl[16169]: Action 'start' failed.
Aug 14 11:46:48 ip-172-30-0-181 apachectl[16169]: The Apache error log may have more information.
Aug 14 11:46:48 ip-172-30-0-181 systemd[1]: apache2.service: Control process exited, code=exited sta
Aug 14 11:46:48 ip-172-30-0-181 systemd[1]: Failed to start The Apache HTTP Server.

2 个答案:

答案 0 :(得分:0)

对于使用apache的用户。您将需要

  • 确保您要托管的站点的根路径中具有.htaccess。范例/ var / www
  • 更新/ etc / apache2 / sites-available / default

发件人

<Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

收件人

<Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>

第二种方式

请参考以下链接

http://linuxtric.blogspot.com/2013/05/wordpress-blank-page-occuring-when.html

https://www.supportsages.com/wp-blank-permalink-page-on-admin-interface/

答案 1 :(得分:0)

也检查文件wp-config.php并尝试发现某些配置错误!

还要检查行是否正确

define('WP_SITEURL','http://example.com/wordpress');

define('WP_SITEURL','http://'。$ _SERVER ['HTTP_HOST']。'/ path / to / wordpressp');

和其他行...