wordpress permalinks not working 404 code example
Example 1: wordpress 404 page after migration
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Example 2: wordpress permalink not working
Follow the following steps to solve this issue:
1. Open the the Apache virtual file for your domain to make changes:
sudo nano /etc/apache2/sites-available/mysite.conf
2. Make these additions on the file
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mysite
ServerName server_domain_name_or_IP
<Directory /var/www/mysite>
AllowOverride All
</Directory>
. . .
3. Save and exit then enable mode rewrite which allows you to modify URLs:
sudo a2enmod rewrite
4. Reload Apache
sudo service apache2 reload
https: