WordPress permalinks not working error 404 – reindexing

Word press site was working only in default permalink settings. After modifying it to month and name, page not found error occurred

WordPress Permalinks not working : error 404


Then I checked the .htaccess file in the WordPress root directory.
# BEGIN WordPressRewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]# END WordPress
Everything was perfect, but the site links were not working
Then I modified the apache httpd.conf file and made the following changes.
Enable mod_rewrite (Already enabled)

LoadModule rewrite_module modules/mod_rewrite.so
Enable Follow symbolic links option and AllowOverride option

< Directory / >
    Options FollowSymLinks
    AllowOverride All
 < /Directory > 

Everything started working

httpd.confg file 


< VirtualHost * >
DocumentRoot /var/www/html/wordpress/
ServerName myserver.com
RewriteEngine On
RewriteRule .* – [F]
< Directory “/var/www/html/wordpress/” >
allow from all
Options FollowSymLinks -Indexes
AllowOverride All
< / Directory >
< / VirtualHost >

#service httpd restart
Restart apache