Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wordpress permalinks not working - htaccess seems ok but getting 404 error on pages

I updated the permalink structure to /%postname%/ and this updated my .htaccess with:

# 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 

But I still get 404 errors on the pages. Are there any other settings that I need to change?

Edit: if it helps the apache log seems to be looking directly in the permalinked folder. I.e.:

[Wed Oct 16 11:12:32 2013] [error] [client xx.xx.xx.xxx] File does not exist: /var/www/exampledomain/news, referer: http://exampledomain.com/ 
like image 479
babbaggeii Avatar asked Oct 16 '13 10:10

babbaggeii


People also ask

Why permalink is not working?

You can fix broken permalinks in WordPress by resetting the permalink settings, replacing . htaccess file with default code, and sorting all conflicting plugins. The broken permalink issue, or the “404 error,” is one of the most common issues on a WordPress site.


1 Answers

For other people landing on this page - Another issue could be (If you are using Apache as your web server) is your httpd.conf or your sites-available/sitename.conf file needs editing.

Your web directory will need to allow the .htaccess file to override it's settings.

look for your web dir in the file - it will be in the bulk of the conf file or segregated into a VirtualHost section.

<Directory /path/to/site>      #add the following setting to allow .htaccess in your web dir to work      AllowOverride FileInfo       #other settings ---  </Directory> 

This will allow you to set up WordPress URLs however you want, within WordPress.

***Edited - Thank You nietonfir For update. Use the least amount of privilege at first. If this doesn't work then replace AllowOverride FileInfo with AllowOverride All

like image 142
MTLHD777 Avatar answered Sep 20 '22 15:09

MTLHD777