|  主页
帮助

Linux 主机 (cPanel) 帮助

What is .htaccess?

Using .htaccess files lets you control the behavior of your site or a specific directory on your site. For example, if you place an .htaccess file in your root directory, it will affect your entire site (www.coolexample.com). If you place it in a /content directory, it will only affect that directory (www.coolexample.com/content).

.htaccess works on our Linux servers.

Using an .htaccess file, you can:

  • Customize the Error pages for your site.
  • Protect your site with a password.
  • Enable server-side includes.
  • Deny access to your site based on IP.
  • Change your default directory page (index.html).
  • Redirect visitors to another page.
  • Prevent directory listing.
  • Add MIME types.

.htaccess files are a simple ASCII text file with the name .htaccess. It is not an extension like .html or .txt. The entire file name is .htaccess. For more information on how to set up .htaccess files, visit Apache's website.

NOTE: Make sure you create an .htaccess file using a plain text editor that doesn't use word wrap. Some editors (such as MS Word or Notepad with Word Wrap enabled) will insert special ASCII codes to signify a line break. Your .htaccess file will not work if it has these special characters in it.


本文是否有帮助?
感谢您的反馈。 要咨询客户服务代表,请使用上面的客户支持电话号码或聊天选项。
很高兴我们能有所助益! 我们还可以为您做些什么?
我们对此深感抱歉。 请告诉我们,什么问题令您费解,或者解决方案为何未能解决您的问题。