You are not logged in.
Hey guys, I created a site dedicated to using htaccess, more for myself than anyone else, but its open to the public.
This should come in real handy when setting up/administering apache especially when setting up a hosting environment with multiple users.
Some articles from the Security Forum
· Prevent Image HotLinking
· Protect your htaccess file
· Htaccess to Secure a Public Directory
· Some Basic Defaults
Some articles from the SSL Forum
· Redirecting All or Part of a Server to SSL
· Create hyperlinks to switch between HTTP and HTTPS
· FORCE HTTPS AND NO DOUBLE LOGIN
· Require SSL before asking for htaccess password!
Some articles from the Authentication Forum
· Order, Allow, Deny
· Deny access to a folder based on the Time
· Block everyone except 1 IP Address
· Deny based on domain name
· Deny a Block of IP Addresses
· Deny A User based on their IP address
· Protect single File
· Protect an entire directory
· Protect multiple specific files
· Basic authentication example
Some articles from the Caching and Optimization Forum
· Caching using headers
· Etags
· Use htaccess to speed up your site discussion
· Cache-Control HTTP Headers
· Limit the Number of Concurrent Visitors to your Website
· Using defaultcharset and defaultlanguage to eliminate meta
· Caching Using mod_expires with expires
Some articles from the SetEnv, PassEnv, UnsetEnv Forum
· SetEnv to Specify CGI/Apache Error Log
· SetEnv to set the server administrator email
· SetEnv to set the server timezone
· Using SetEnv to instruct php to use custom php.ini
Some articles from the SEO Forum
· Creating SEO Friendly URL redirector
· Permanently renaming a file or directory
· SEO Friendly URLs for PHP
· Requiring the WWW
Offline
When site is Under Construction
Redirect everyone to different site except 1 IP
Redirect everyone to different site except 1 IP
Redirect Everyone but you to alternate page on your server.
Set the Timezone of the server
Set the Server Administrator Email
Turn off the ServerSignature
Force Files to download, do not display in browser
Process All .gif files with a cgi script
Process Requests with certain Request Methods
Make any file be a certain filetype
Use IfModule directive for robust code
Prevent Caching 100%
Remove IE imagetoolbar without meta tag
Add Privacy (P3P) Header to your site
Add a en-us language header and urf-8 without meta tags!
Using AddType
Using the Files Directive
Using the FilesMatch Directive
When php run as CGI
Use a custom php.ini with mod_php or php as a cgi
When php run as Apache Module (mod_php)
When cgi php is run with wrapper (FastCGI)
SEO Search Engine Friendly Redirects without mod_rewrite
For single moved file
Redirect Home to new Domain
For multiple files like a blog/this.php?gh
Redirect Entire site to single file
Mostly .htaccess rewrite examples should begin with:
Check for a key in QUERY_STRING
Removes the QUERY_STRING from the URL
Fix for infinite loops
Require the www
Require no www
Redirect .php files to .html files (SEO friendly)
Redirect .html files to actual .php files (SEO friendly)
block access to files during certain hours of the day
Rewrite underscores to hyphens for SEO URL
Require the www without hardcoding
Require no subdomain
Require no subdomain
Redirecting Wordpress Feeds to Feedburner
Only allow GET and PUT request methods
Prevent Files image/file hotlinking and bandwidth stealing
Stop browser prefetching
Make a prefetching hint for Firefox.
Speed up your site with Caching and cache-control
htaccess time cheatsheet
Caching with both mod_expires + mod_headers
Caching with mod_headers
Caching with mod_expires
Apache Authentication in htaccess
Require password for 1 file only
Protect multiple files:
Using the Apache Allow Directive in htaccess
network/netmask pair
IP address
More than 1 IP address
Partial IP addresses, first 1 to 3 bytes of IP, for subnet restriction
network/nnn CIDR specification
IPv6 addresses and subnets
Deny subdomains
Allow from IP without password prompt, and also allow from any address with password prompt
Skeleton .htaccess file to start with
CHMOD your files
Prevent access to .htaccess and .htpasswd files
Show Source Code instead of executing
Securing directories: Remove the ability to execute scripts
ErrorDocuments
Common STATUS Codes and ErrorDocument Implementations
When using CGI PHP, php 404 Error example
An example 404 Error page in perl cgi
ErrorDocuments generated by Apache
Redirect non-https requests to https server
Rewrite non-https to HTTPS without mod_ssl!
Based on HTTPS variable (best)
Based on SERVER_PORT
Redirect everything served on port 80 to HTTPS URI
Redirect particular URLs to a secure version in an SSL SEO method
Check to see whether the HTTPS environment variable is set
Rewrite to SSL or NON-SSL using relative URL!
Using visitor dependent environment variables:
Special Purpose Environment Variables
SetEnvIf
SetEnvIfNoCase Example
SetEnvIfNoCase Example 2
Last edited by midas (2007-03-31 06:37:48)
Offline
Wow.. it's great.. Thanks a lot..!
Quis custodiet ipsos custodiet?
Offline
Oh my god dear lord thank you for this wonderful site. So much info about things I don't have the time to google all day.
THANK YOU
Offline