Forum Moderators: phranque
I have a CentOS server that is running my clients website. I was putting together a basic Wordpress site to replace theirs.
When setting the permalinks to be something other than the default, like "Month and Name" (http://wordpress.example.com/2009/12/sample-post/), Apache doesn't seem to want to rewrite the urls for me. I end up getting 404 errors.
Here is my .htaccess:
Options FollowSymLinks
AllowOverride All
# BEGIN WordPress
<IfModule mod_rewrite.c>
ErrorDocument 404 /index.php?error=404
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress Note: Between the BEGIN and END Wordpress, that part was automatically written by Wordpress based off of the Permalink type I choose. So I can't image that Wordpress wrote out what it needed incorrectly... This leads me to believe that the problem lies somewhere in my Apache configuration.
Checking httpd.conf I see that I do have mod rewrite loaded. PHP's phpinfo(); also confirms that I have Apache's mod_rewrite loaded.
If you click on News or About or something like that, the permalink should end up being something like this:
http://wordpress.example.com/news/
or
http://wordpress.example.com/about/
But Wordpress gives a 404 instead.
The Wordpress installation is the default setup with no plugins loaded and using the default theme.
Anyone got any ideas or experience in this area? I really have no idea what I'm missing here. I'm taking over basic tech/admin stuff for a former employee and I have no idea what kind of weird Apache/PHP configuration setup he has going on this server.
[edited by: jdMorgan at 12:57 am (utc) on Dec. 14, 2009]
[edit reason] No URLs, please. See TOS, [/edit]
I'd recommend the following settings and syntax:
Options +FollowSymLinks -MultiViews -Indexes Options +FollowSymLinks -MultiViews If you're so inclined, take a look at all of the possible settings for Options in the Apache Core documentation for your server version.
Hopefully, fixing the Options will help, because it does appear that you've got a bog-standard WP mod_rwrite rule there. There are several improvements that can be made to that code, but that's a secondary issue to getting what you currently have there working as expected.
Jim
[edited by: jdMorgan at 10:41 pm (utc) on Dec. 14, 2009]