changing the .htaccess file in wordpress
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>
NewUser
I am just a beginner in the field of web. I like to know about new technology behind Web Sites and Web Applications.
Updated on June 04, 2022Comments
-
NewUser almost 2 years
I was trying to use
permalink feature
ofWordPress
on mylocalhost
so I just made copy the code which wasgenerated by WordPress
when I clicked onpost name from Common Settings
. I saved that generated code in my localhost where thewordpress index.php
file was stored in the name of.htaccess
and now when I am going to visit the page, url bar of thebrowser is showing the full address of the post
but thepost can not be seen on the browser
.Only the404 Not Found error is comming
. Can someone tell me what is the wrong part here? -
Paul Leclerc about 5 years@MadanBhandari in the .htaccess file as suggested in the sentence bellow.
-
Jodyshop about 4 yearsThanks, worked as expected. But in case you're hosted your website on windows localhost you only need to change the <code>/wordpress/</code> to your actual directory name. Thanks