|
||
|
![]() |
The Apache web server is highly configurable using .htaccess files. These files let you add password protection, SSIs,
URL rewriting and more to individual directories on your web sites. However, these files are not used by Tomcat for JSP or servlet-based files. Controlling index listingsBy default, the Apache server displays a listing of files when no index file exists in a directory. On some directories, you might not want this behavior. To turn off index listings, create a file called .htaccess in the desired directory containing the following text:Options -Indexes
This will turn off index listings for the directory and all subdirectories. Enabling Server Side Includes (SSIs)Because they increase the amount of processing required to serve files, Server Side Includes are turned off by default. If you want to run SSIs in one of your directories, you can enable them by creating a .htaccess file with the following text:
Options +Includes
This will cause any file named with a .shtml extension to be processed first by the server. URL RewritingIf content moves from one directory to another, you can have Apache automatically redirect the requests using a RewriteRule. An example might look as follows:
RewriteEngine on
This would cause any request for pages inside /olddirectory to be redirected to the equivalent page in /newdirectory. RewriteRules can be used for a wide range of configuration requirements. They are documented in greater detail in the Apache Server Manual. Important: An improperly configured .htaccess file can cause your site to become inaccessible. Always test your site's reachability after making any .htaccess file changes.
Note: MMA technical support staff cannot provide troubleshooting of problems with third-party CGI scripts including but not limited to: Perl scripts, C/C++ binaries, PHP or web/database integration unless these services are specifically contracted. For these services, please see our Quote Request Form. |
||||
|
Copyright
© 1995-2012
Motivational Marketing Associates, LLC
All Rights Reserved.