I just moved a Wordpress site to new host. But when I go to any page except the HOME page, I got this error:
Not Found
The requested URL /about was not found on this server.
Apache/2.2.16 (Debian) Server at 176.xx.yy.zz Port 80
I changed the Permalink setting to Default which make the URL looks like mysite.com/?page_id=5
and the page shows up fine. So the problem is not in my code.
My first guess is mod_rewrite
isn't enabled. But phpinfo()
tells me that mod_rewrite
is loaded properly.
My .htaccess is generated automatically and looks like:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /beta-test/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /beta-test/index.php [L]
</IfModule>
# END WordPress
Any solution?
Thanks
Switch the Permalinks Setting This is where you go to your WordPress Dashboard → Settings → Permalinks. Then, you need to choose Post Name and click on the button Save Changes. Yes, that's all.
The HTTP error 404, more commonly called “404 error”, means that the page you are trying to open could not be found on the server. This is a client-side incident which means either the page has been deleted or moved, and the URL has not been modified accordingly, or that you have misspelled the URL.
You need to edit your Apache http.conf
file and
change #LoadModule rewrite_module modules/mod_rewrite.so
to LoadModule rewrite_module modules/mod_rewrite.so
On versions of Apache2 where http.conf is no longer present (i.e. ubuntu) you can use the command a2enmod rewrite to enable the module.
Assuming your .htaccess file is in place, this is most likely caused by the Apache rewrite module not being enabled on your new server. On Ubuntu do this:
sudo a2enmod rewrite
sudo apache2ctl restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With