Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
726 views
in Technique[技术] by (71.8m points)

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/
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...