If you install a wordpress blog on localhost using WampServer, you will need to create a .htaccess file in order to make your blog and its plugins working properly. But Windows will not allow you creating a file with named .htaccess. So how can we create .htaccess file on Windows?
I’ve dealt with this problem when testing some wordpress plugins on localhost. First try I created a txt file, and then has it renamed to .htaccess, but Windows return an error message: “You must type a filename”. This means that Windows does not allow files with no name before dot (.) symbol. Then I tried these step to create .htaccess file on Windows:
- Creating a text file (.TXT) by right click → New → Text Documents, rename the file to a.htaccess
- Press Windows key + R to open Windows Run dialog
- Enter the command below to Run dialog and press Enter:
ren "C:\Users\asus\Desktop\a.htaccess" .htaccess
with “C:\Users\asus\Desktop\” is the path of a.htaccess file
The above command will rename the file a.htaccess to .htaccess
You’ve done. You will have a .htaccess file, simply copy it to wordpress blog directory, edit it with any text editors (you can use Notepad) and save it. Your wordpress blog and plugins will working properly with this .htaccess file
Please leave a comment below if you have faced with this problem and solved it.
Thank you very much.