Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress permalink 'not found on this server'

Tags:

wordpress

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

like image 758
hrsetyono Avatar asked Sep 26 '13 03:09

hrsetyono


People also ask

How do I fix Page Not Found After changing permalinks in WordPress?

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.

Why does it say the requested URL was not found on this server?

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.


2 Answers

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.

like image 200
Vaibs_Cool Avatar answered Oct 02 '22 04:10

Vaibs_Cool


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
like image 38
Alan Viars Avatar answered Oct 02 '22 03:10

Alan Viars