If WordPress “post name” permalinks return 404 errors on an Apache server, Apache probably isn’t allowing the .htaccess rewrite rules WordPress depends on. The fix is a one-line change.
Steps
- Open the Apache configuration file at
/etc/httpd/conf/httpd.conf. - Find the Directory block for your DocumentRoot, normally
<Directory "/var/www/html">. - Change
AllowOverride NonetoAllowOverride All. - Restart Apache.
<Directory "/var/www/html">
AllowOverride All
</Directory>
service httpd restart
This step is essential for WordPress post name permalinks to work.
