.htaccess

From Ubiquity Web Hosting Wiki

Jump to: navigation, search
  • .htaccess files are used to control local Apache settings with commands called directives
  • When you save a text file as .htaccess and upload it, it effects everything in that directory and above on a website
    • If you upload a second .htaccess file in a higher level, it overrides the .htaccess settings in others beneath it
  • Files starting with a . are hidden files in Linux. They won't appear in the web file manager, or an FTP client with hidden files disabled.
  • A syntax problem in a .htaccess file is almost always the cause of Error 500
  • Many features used in a .htaccess file can be controlled from your web control panel without directly accessing the file
  • There are no start or end tags in these files


Apache Directive Examples

Comment

# I'm a comment!!!  This won't break things!!!

Create a 301 redirect (make the root of a site resolve to awesome.php instead) using mod_alias

redirect 301 / awesome.php
Personal tools