Reputation: 55
After migrating my WordPress sites from my old hosting provider to my new VPS thought my sites works fine but it was giving 404 not found everywhere it's a redirection issue because the home page is working fine.
My rewrite mod is activated, the .htaccess
is the default WordPress one,
for migrating the site I proceed like this:
I copied this from WordPress official documentation and it worked fine for other sites but now it's not working.
Tried to google the issue but I haven't got the solution.
This is my .htaccess
file (standard wordpress):
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
AddHandler x-mapp-php5.5 .php
# BEGIN WordPress
# END WordPress
Upvotes: 1
Views: 1325
Reputation: 55
The solution is so simple but can be caused by various factors
1) You must check if your apache mod_rewrite is enabled
2) Check if Allowoverride is set to All
3) Check if you have a .htaccess file
4) Check if Wordpress have the right to write on it (chmod 666 .htaccess)
for %postname% permalink check if you have a similar .htaccess to this one :
#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>
AddHandler x-mapp-php5.5 .php
# 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
For my case i forgot to set Allowoverride in a correct way
Upvotes: 1