WordPress permalink ‘not found on this server’

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.

Read More

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

Related posts

Leave a Reply

5 comments

  1. 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.

  2. 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
    
  3. I believe this could be because of these three issues also.

    1. AccessFileName .htaccess is commented in your apache config.
    2. AllowOverride ALL is not mentioned in your apache config for wordpress path.
  4. 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.