In the last post, we discussed how to edit .htaccess file. In this post I’m going to cover how you can create this file. If you have installed WordPress on your blog then you would be having a default .htaccess file having below content –
[code]
# BEGIN WordPress
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress [/code]
How to create it?
In case you don’t have this file then you can simply create a htaccess.txt file (You may face some difficulties while creating a file named .htaccess as Windows may prevent this to happen) and copy the above content. Upload the file to server and rename it to .htaccess from htaccess.txt.
What should be the ideal file permissions for .htaccess after creation?
Do not compromise with the security of this file as this is one of the sensitive file and if you don’t prevent it viewing by others then it may cause several security issues.
The permissions should be: 644 (RW-R–R–)
In order to change the permissions login to cpanel. Refer the screenshots –
» Right click on the file and click on “change permissions”.
» Change it to 644 as shown below –
You can do several things with this file, if you handle it properly. I’ll share more about it in upcoming posts. That’s all for now. Happy reading!!
Leave a Reply