/ Published in: Apache
Expand |
Embed | Plain Text
#Redirecting to lowercase RewriteMap lc int:tolower RewriteCond %{REQUEST_URI} [A-Z] RewriteRule (.*) ${lc:$1} [R=301,L] #This rule is perfect to redirecting the hundreds of daily requests for misplaced robots.txt files such as the following: # http://dominio.com/foo/robots.txt # http://dominio.com/foo/bar/robots.txt # http://dominio.com/foo/2009/05/09/robots.txt # http://dominio.com/foo/bar/xyz/robots.txt RedirectMatch 301 robots\.txt http://dominio.com/robots.txt #Redirect favicon.ico & favicon.gif RedirectMatch 301 favicon\.ico http://perishablepress.com/favicon.ico RedirectMatch 301 favicon\.gif http://perishablepress.com/favicon.ico #Error 404 ErrorDocument 404 errors/404.html #Environment Variables SetEnv APPLICATION_ENV development #Cache #1 Year <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$"> Header set Cache-Control "public" Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" Header unset Last-Modified </FilesMatch> #2 Hours <FilesMatch "\.(html|htm|xml|txt|xsl)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" </FilesMatch> #Compress output using GZIP <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule> #Redirecting non www URL to www URL RewriteEngine On RewriteCond %{HTTP_HOST} ^viralpatel\.net$ RewriteRule (.*) http://www.viralpatel.net/$1 [R=301,L] #Change Charset and Language headers AddDefaultCharset UTF-8 DefaultLanguage ens-ES #Send Custom Headers Header set X-Pingback "http://www.askapache.com/xmlrpc.php" Header set Content-Language "es-ES"
You need to login to post a comment.
