开发者

How to return a blank page if there isn't an index page in the folder using htaccess

How to return a blank page if there isn't an index page in the folder using htaccess

Take a look : http://webdev.faressoft.org/wp-admin/images开发者_StackOverflow中文版/

I do not want any one to see the names of these files


You could create an empty index page. There's a much better solution though: Add Options -Indexes to your .htaccess file; that will result in a 403 error page instead of a directory listing.

If you really want a blank page you can add ErrorDocument 403 " " to your .htaccess (don't forget the space, an empty string won't work!)


Options -Indexes
ErrorDocument 403 " "

However, some browsers (Internet Explorer and Chrome) ignore short error pages.


Make a defualt error page. if index page does'nt exist redirect to that error page. simply write this code in .htaccess file.

    ErrorDocument 404 http://www.yoursite.com/404.htm 

404.htm is your own created error page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜