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
You need to edit your Apache
http.conf
file andchange
#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:
I believe this could be because of these three issues also.
This might be a problem with the paths defined in the rewrite rule
Consider changing the following in the rewrite rules in the .htaccess file
That worked for me.
This is simple, run:
If you are running on apache2.