Reputation: 4464
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
Upvotes: 8
Views: 17029
Reputation: 3162
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
Upvotes: 6
Reputation: 1295
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
# 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
That worked for me.
Upvotes: 1
Reputation: 11
This is simple, run:
shell > a2enmod rewrite enable
If you are running on apache2.
Upvotes: 0
Reputation: 6156
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.
Upvotes: 8
Reputation: 571
I believe this could be because of these three issues also.
Upvotes: 3