I had the same problem tried to change the permalinks from
Default: /wordpress/?p=123
to
Post name:/wordpress/sample-post/
The default was working fine but the others just won’t.
I used wordpress 3.4.2, Apache/2.2.22 (Win32) PHP/5.4.5 Mysql 5.0.
I end up spending 2 frustrating hours on this issue. None of the solutions above made any difference still getting the annoying message:
“404 Not Found
The requested URL /mydomain/testpage/ was not found on this server.”.
The trouble is that the installation of WordPress is not in the DocumentRoot. (The directory out of which you will serve your documents is then different than the default Document Root.)
By default, all requests are taken from this directory, but
symbolic links and aliases may be used to point to other locations.
The solution is easy to apply:
1.Turn the engine on for your host or vhost or directory by making sure
your .htacces file looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /name_of_your_wordpress_installation_folder/
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress
2. If you have access to you server configuration file httpd.conf open it in a text editor and change the following:
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so
in other words take out the leading #
then find in the same httpd.conf file:
Dont change the “default” which looks like this:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from All
</Directory>
keep looking for this format
<Directory “path/to/your/Documentroot”>
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Deny from all
</Directory>
and change it to
<Directory “path/to/your/Documentroot”>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Remember to change path/to/your/Documentroot to your actual path ex.
<Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”>
Hope this helps it did the trick for me.