How to hide file name using htaccess?

You can mask / hide a filename from public & bot access or from hackers. All you have to do is use following code in your .htaccess & replace your file name data with it:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /
RewriteRule ^data/sss.html /template/mytemplate/css/ss.css [L,QSA]

In this article, we are hiding  /template/mytemplate/css/ss.css & website is showing data/sss.html instead, they can still be able to see css data but not other files or structure details. 

  • hide file, mask file, hide file name, name rewrite, rewrite
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to block visitors by referrer domain using htaccess?

Being a website owner, you might have seen a lot of traffic coming from external websites to your...

How to block bad bots using htaccess?

There are hundreds of search engines, thousands of crawlers & bots do crawl your website which is...

How to change server default signature using htaccess?

There are chances where a bot or a user tries to access a non-existing page which shows default...

how to change your web servers date timezone using htaccess?

You may have hosted your website on a shared server where the DC located in a foreign country &...

How to prevent content & bandwidth theft using htaccess?

When you have a decent website with your own articles, images, media contents, clip arts etc....