在Fedora上的WordPress中损坏的永久链接

时间:2018-11-07 11:10:19

标签: wordpress permalinks

最近几天我一直在b头,无法弄清:(除了简单之外,永久链接的其他选项均无效。

Fedora 23,Wordpress 4.9.8,Apache / 2.4.23(Fedora)OpenSSL / 1.0.2j-fips PHP / 7.0.22

httpd.conf

<Directory "/var/www/html">
    AllowOverride All
    # Allow open access:
    Require all granted
</Directory>

.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>

将CHMOD更改为660、666、777无效。

通过单击“保存设置”按钮尝试“刷新”永久链接的技巧。也不起作用。

也启用了Mod_rewrite。

编辑

<?php

/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('WP_CACHE', true);
define( 'WPCACHEHOME', '/var/www/html/wpsite/wp-content/plugins/wp-super-cache/' );
define('DB_NAME', 'wpsite');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', ' :D ');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         ' :D ');
define('SECURE_AUTH_KEY',  ' :D ');
define('LOGGED_IN_KEY',    ' :D ');
define('NONCE_KEY',        ' :D ');
define('AUTH_SALT',        ' :D ');
define('SECURE_AUTH_SALT', ' :D ');
define('LOGGED_IN_SALT',   ' :D ');
define('NONCE_SALT',       ' :D ');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wpsite_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

wp-config.php中的一切看起来都很正常

2 个答案:

答案 0 :(得分:0)

这可能是由插件引起的。 通过FTP连接,并将wp-content中的plugins文件夹重命名为其他名称,然后尝试刷新页面。如果有效,则只需再次将plugins文件夹重命名为其原始名称“ plugins”。这将禁用您网站上的所有插件。然后您可以测试是哪个引起了问题。我希望这会有所帮助。 祝你好运

答案 1 :(得分:-1)

在Fedora 29,Wordpress 4.9.8,Apache 2.4.37-3,php 7.2.12-1(均使用Fedora软件包安装)中仍然存在相同的问题。

可能帮助人们诊断问题的一件事:RedHat以非常锁定的模式提供了Wordpress,可防止安装插件:

define('DISALLOW_FILE_MODS',true);

wp-config.php中的

甚至可以防止wordpress显示“添加插件”按钮。可能有类似情况阻止永久链接起作用吗?

没有安装插件,也没有安装opcache。