My problem is in my wordpress site only default permalinks is working.. When I change permalinks all pages become not found.. only home page is showing.
When I change permalinks to postname .htaccess content change to
# 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
And for default it is
# BEGIN WordPress
# END WordPress
Also tried to get the status of mod_rewrite using this
in_array( 'mod_rewrite', apache_get_modules())
It returns 1 and mod_rewrite is enabled on my server and also checked using phpinfo(). mod_rewrite
module is loaded.. I have gone through all the documents available in internet.. Please help me to solve this problem.. My hosting server is godaddy..
I had the exact same issue and fixed it by running
Then restarted apache. Apparently the issue is caused by
mod_rewrite
potentially not working properly on ubuntu.I found the solution here
It could be a broken
rewrite_rules
field in your database.I installed "Yoast SEO" into a live site and that broke it completely. I disabled the plugin but it didn't go back to working. Only default permalinks would work.
Like everyone else I tried the usual things - checking
.htaccess
, making sure thatmod_rewrite
was working on the server, saving the permalinks settings again, but nothing was working. The homepage would load, andwp-admin
pages would load, but everything else was just loading the "Latest Posts" default page.In the end it turned out to be something wrong with the
rewrite_rules
field ofwp_options
in the database.I had three versions of the site (local, staging and production), and all were from one SVN base, so I knew it was not a file issue. But only the local development version was working.
I replaced the contents of the
rewrite_rules
field of the broken live site with the working one from my local development site, and it worked.What's really weird is that deleting the
rewrite_rules
field and having WordPress rebuild it did not fix the problem. Only replacing with the contents of a previously working version of the site did the trick.I'm still puzzled by this, and will edit this reply if I find out anything further about the problem.
Not sure this is too late. i faced the same issue and solved by changing
to
in /etc/apache2/sites-enabled/000-deafult.conf file. hope this would help.
suffered from the same issue. Having site on SSL had to change NOT the 000-default.conf but the respective SSL conf file. Adding
after DocumentRoot /var/www/html
and then restarting apache2 saved my site.... nothing else worked. The issue was Wordpress SSL and SEO plugins messing up config files.
In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf (here we have an example of /var/www):
and change it to:
also check Apache configuration file for your website /etc/apache2/sites-available/your_site.conf:
and change it to:
You need to do sudo a2enmod rewrite to enable module rewrite
then,
sudo service apache2 restart
I hope this helps you!