简体   繁体   中英

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?

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 , eg 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM