I have migrated WordPress website to new server (Ubuntu) which is working fine.
But Permalinks settings are not working. All other pages returning me 404 error.
I already enabled mod_rewrite
When I use custom structure and type /%postname% it shows Permalink structure updated. and while visiting the page it returns be 404 error.
I am using /var/www/html/wordpress Installation directory/ as a folder and I have change /etc/apache2/sites-available/000-defaul-config to
DocumentRoot /var/www/html/wordpress Installation directory
and below in my .htaccess file
# 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
Any idea what is wrong?
5条答案
按热度按时间2eafrhcq1#
Try https://codex.wordpress.org/Using_Permalinks#Fixing_Other_Issues
AllowOverride Not Enabled Your server may not have the AllowOverride directive enabled. If the AllowOverride directive is set to None in your Apache httpd.config file, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem. When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files. Example of enabled AllowOverride directive in httpd.config:
You may also have to enable the AllowOverride directive in your DocumentRoot:
qv7cva1a2#
Wordpress permalink fix
1.open phpmyadmin.
2.find your wordpress database.
3.Look for wp_options table.
4.Check first two fields and update option_value with your correct wordpress location.
5.Reload permalink.
qjp7pelc3#
对于像我这样的人谁有问题的永久链接与修改重写启用,
AllowOverride All
在vhost和所有良好的指令在. htaccess。我花了几个小时才发现我把
AllowOverride All
放在了http(:80)的vhost中,而不是https(:443)的vhost中。希望这能为你保存一些时间。=)
wwwo4jvm4#
WordPress permalink fix
wp_options
table.permalink_structure
set value to blankmodrewrite
lines in your.htaccess
if necessary Your WordPress is in plain permalink modeIn case
modrewrite
is not active and interactive setup doesn't work.tez616oj5#
All the answers forgets to mention that if you are under SSL and your httpd.conf say this:
then into httpd-ssl.conf file
you have to change
into
AllowOverride All
too!
Cheers