70 handy .htaccess tricks

Discussion in 'Apache' started by Your Content, Feb 9, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Surfing the web in the quest of a solution to add headers and footers via .htaccess I found a site that thought to share with you because of the number of tricks posted there can be useful to many of you.

    This is the list of available tricks:

    • htaccess definition
    • htaccess comments
    • important information
    • performance issues
    • regex character definitions
    • redirection header codes
    • htaccess comments
    • enable basic rewriting
    • enable symbolic links
    • enable AllowOverride
    • rename the htaccess file
    • disable AllowOverride
    • pass the character set
    • preserve bandwidth
    • disable the server signature
    • set the server timezone
    • set admin email address
    • enable file caching
    • set default language & character set
    • declare specific/additional MIME types
    • send headers without meta tags
    • limit request methods to GET/PUT
    • process files according to request method
    • execute various file types via CGI script
    • prevent access to htaccess
    • prevent access to any file
    • prevent acess to multiple file types
    • prevent unauthorized directory browsing
    • change the default index page
    • disguise script extensions
    • limit access to the LAN
    • secure directories by IP or domain
    • deny/allow domain access for IP range
    • deny/allow multiple IP addresses on one line
    • miscellaneous rules for blocking/allowing
    • stop hotlinking, serve alternate content
    • block robots, rippers, and offline browsers
    • more stupid blocking tricks
    • even more scum-blocking tricks
    • password-protect directories
    • password-protect files, directories, and more
    • require SSL (secure sockets layer)
    • automatically CHMOD various file types
    • disguise all file extensions
    • limit file upload size
    • disable script execution
    • minimize CSS image flicker in IE6
    • deploy custom error pages
    • provide a universal error document
    • employ basic URL spelling check
    • force media downloads
    • display file source code
    • redirect visitors during site development
    • provide password-prompt during site development
    • prevent access during specified time periods
    • important note about redirecting via mod_rewrite
    • redirect from www-domain to non-www-domain
    • redirect from an old domain to a new domain
    • redirect string variations to a specific address
    • other fantastic redirect tricks
    • send visitors to a subdomain
    • more fun with RewriteCond & RewriteRule
    • more fun with Redirect 301 & RedirectMatch 301
    • secure wordPress contact forms
    • wordpress permalinks
    • activate SSI for HTML/SHTML file types
    • grant CGI access in a specific directory
    • disable magic_quotes_gpc for PHP enabled servers
    • enable MD5 digests
    • expression engine tricks
    and this is the URL to find them: http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
    .
     
    Your Content, Feb 9, 2007 IP
Thread Status:
Not open for further replies.