changing the .htaccess file in wordpress

I was trying to use permalink feature of WordPress on my localhost so I just made copy the code which was generated by WordPress when I clicked on post name from Common Settings. I saved that generated code in my localhost where the wordpress index.php file was stored in the name of .htaccess and now when I am going to visit the page, url bar of the browser is showing the full address of the post but the post can not be seen on the browser.Only the 404 Not Found error is comming. Can someone tell me what is the wrong part here?

Related posts

Leave a Reply

1 comment

  1. You should let wordpress write this file for your localhost server.

    You cannot simply copy .htaccess from another server and expect it will work, you have to modify it to reflect your server conf.

    You should modify RewriteBase and the last RewriteRule, e.g. for http://localhost/wordpress :

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>