SlideShare uma empresa Scribd logo
1 de 3
Baixar para ler offline
.htaccess Cheatsheet
Enable Directory Browsing

Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi

Disable Directory Browsing

Options All -Indexes

Customize Error Messages

ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html

Get SSI working with HTML/SHTML

AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htm

Change Default Page (order is followed!)

DirectoryIndex myhome.htm index.htm index.php

Block Users from accessing the site

<limit GET POST PUT>
order deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
</limit>

Allow only LAN users

order deny,allow
deny from all
allow from 192.168.0.0/24

Redirect Visitors to New Page/Directory

Redirect oldpage.html http://www.domainname.com/newpage.html
Redirect /olddir http://www.domainname.com/newdir/
Block site from specific referrers

RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2.com [NC]
RewriteRule .* - [F]

Block Hot Linking/Bandwidth hogging

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC]
RewriteRule .(gif|jpg)$ - [F]

Want to show a “Stealing is Bad” message too?

Add this below the Hot Link Blocking code:

RewriteRule .(gif|jpg)$ http://www.mydomain.com/dontsteal.gif [R,L]

Stop .htaccess (or any other file) from being viewed

<files file-name>
order allow,deny
deny from all
</files>

Avoid the 500 Error

# Avoid 500 error by passing charset
AddDefaultCharset utf-8

Grant CGI Access in a directory

Options +ExecCGI
AddHandler cgi-script cgi pl
# To enable all scripts in a directory use the following
# SetHandler cgi-script


Enable Gzip – Save Bandwidth

# BEGIN GZIP
<ifmodule mod_deflate.c>
# Combine the below two lines - I've split it up for presentation
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml
text/css
  application/x-javascript application/javascript
</ifmodule>
# END GZIP
Turn off magic_quotes_gpc

# Only if you use PHP
<ifmodule mod_php4.c>
php_flag magic_quotes_gpc off
</ifmodule>

Set an Expires header and enable Cache-Control

<ifmodule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 7200 seconds"
  ExpiresByType image/gif "access plus 518400 seconds"
  ExpiresByType image/jpeg "access plus 518400 seconds"
  ExpiresByType image/png "access plus 518400 seconds"
  ExpiresByType text/css "access plus 518400 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifmodule>

<ifmodule mod_headers.c>
  # Cache specified files for 6 days
  <filesmatch ".(ico|flv|jpg|jpeg|png|gif|css|swf)$">
  Header set Cache-Control "max-age=518400, public"
  </filesmatch>
  # Cache HTML files for a couple hours
  <filesmatch ".(html|htm)$">
  Header set Cache-Control "max-age=7200, private, must-revalidate"
  </filesmatch>
  # Cache PDFs for a day
  <filesmatch ".(pdf)$">
  Header set Cache-Control "max-age=86400, public"
  </filesmatch>
  # Cache Javascripts for 2.5 days
  <filesmatch ".(js)$">
  Header set Cache-Control "max-age=216000, private"
  </filesmatch>
</ifmodule>

Mais conteúdo relacionado

Mais procurados

PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookiesFirdaus Adib
 
When dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWhen dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWim Godden
 
PHP Cookies and Sessions
PHP Cookies and SessionsPHP Cookies and Sessions
PHP Cookies and SessionsNisa Soomro
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NETShingalaKrupa
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dkStan Adrian
 
Hack password documen file word
Hack password documen file wordHack password documen file word
Hack password documen file wordDarwin Al-ghifari
 

Mais procurados (14)

PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookies
 
Php cookies
Php cookiesPhp cookies
Php cookies
 
When dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniquesWhen dynamic becomes static : the next step in web caching techniques
When dynamic becomes static : the next step in web caching techniques
 
Demystifying REST
Demystifying RESTDemystifying REST
Demystifying REST
 
Php sessions
Php sessionsPhp sessions
Php sessions
 
Introduction to php web programming - sessions and cookies
Introduction to php   web programming - sessions and cookiesIntroduction to php   web programming - sessions and cookies
Introduction to php web programming - sessions and cookies
 
Using MongoDB
Using MongoDBUsing MongoDB
Using MongoDB
 
Install mongo db on centos
Install mongo db on centosInstall mongo db on centos
Install mongo db on centos
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
PHP Cookies and Sessions
PHP Cookies and SessionsPHP Cookies and Sessions
PHP Cookies and Sessions
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NET
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dk
 
Hack password documen file word
Hack password documen file wordHack password documen file word
Hack password documen file word
 
33 meta
33 meta33 meta
33 meta
 

Destaque

Софит-Люкс - 10 лет успеха
Софит-Люкс - 10 лет успехаСофит-Люкс - 10 лет успеха
Софит-Люкс - 10 лет успехаSofit Lux
 
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar Gun
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar GunSmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar Gun
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar GunSmartPitch LLC
 
ROSEdu Tech Talks Prezentarea 01: Preprocesorul C
ROSEdu Tech Talks Prezentarea 01:  Preprocesorul CROSEdu Tech Talks Prezentarea 01:  Preprocesorul C
ROSEdu Tech Talks Prezentarea 01: Preprocesorul CROSEdu
 
Visions On Governance Cpl
Visions On Governance CplVisions On Governance Cpl
Visions On Governance Cplsynergus
 
Schools That Work
Schools That WorkSchools That Work
Schools That Workcdcummings
 
OpenStreetMap integration into Wikimedia projects
OpenStreetMap integration into Wikimedia projectsOpenStreetMap integration into Wikimedia projects
OpenStreetMap integration into Wikimedia projectsavarab
 
Asce Presentation
Asce PresentationAsce Presentation
Asce Presentationalexsndiego
 
J W T Anxiety Index Quarterly Summer2009(1)
J W T  Anxiety Index Quarterly  Summer2009(1)J W T  Anxiety Index Quarterly  Summer2009(1)
J W T Anxiety Index Quarterly Summer2009(1)APG México
 
Presentation1
Presentation1Presentation1
Presentation1blawro
 
Delux Auto 2009
Delux Auto 2009Delux Auto 2009
Delux Auto 2009Sofit Lux
 
Fasttrack
FasttrackFasttrack
Fasttrackdcbach
 
Blu as presentation
Blu as presentationBlu as presentation
Blu as presentationOnizukar
 

Destaque (20)

Софит-Люкс - 10 лет успеха
Софит-Люкс - 10 лет успехаСофит-Люкс - 10 лет успеха
Софит-Люкс - 10 лет успеха
 
HUMAk, Civic Activities and Youth Work Unit
HUMAk,  Civic Activities and Youth Work UnitHUMAk,  Civic Activities and Youth Work Unit
HUMAk, Civic Activities and Youth Work Unit
 
Verkko ja nuorisotyön toimintaympäristö, Päivi Timonen, Humak (2013 syksy)
Verkko ja nuorisotyön toimintaympäristö, Päivi Timonen, Humak (2013 syksy)Verkko ja nuorisotyön toimintaympäristö, Päivi Timonen, Humak (2013 syksy)
Verkko ja nuorisotyön toimintaympäristö, Päivi Timonen, Humak (2013 syksy)
 
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar Gun
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar GunSmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar Gun
SmartPitch tm Pro-Level Precision for Fraction of Price of Expensive Radar Gun
 
Who is jesus
Who is jesusWho is jesus
Who is jesus
 
ROSEdu Tech Talks Prezentarea 01: Preprocesorul C
ROSEdu Tech Talks Prezentarea 01:  Preprocesorul CROSEdu Tech Talks Prezentarea 01:  Preprocesorul C
ROSEdu Tech Talks Prezentarea 01: Preprocesorul C
 
Visions On Governance Cpl
Visions On Governance CplVisions On Governance Cpl
Visions On Governance Cpl
 
Schools That Work
Schools That WorkSchools That Work
Schools That Work
 
OpenStreetMap integration into Wikimedia projects
OpenStreetMap integration into Wikimedia projectsOpenStreetMap integration into Wikimedia projects
OpenStreetMap integration into Wikimedia projects
 
Asce Presentation
Asce PresentationAsce Presentation
Asce Presentation
 
Humak in english2013
Humak in english2013Humak in english2013
Humak in english2013
 
Rd200 2014
Rd200 2014Rd200 2014
Rd200 2014
 
J W T Anxiety Index Quarterly Summer2009(1)
J W T  Anxiety Index Quarterly  Summer2009(1)J W T  Anxiety Index Quarterly  Summer2009(1)
J W T Anxiety Index Quarterly Summer2009(1)
 
Presentation1
Presentation1Presentation1
Presentation1
 
Philadelphia Project Overview09
Philadelphia Project Overview09Philadelphia Project Overview09
Philadelphia Project Overview09
 
Humak: hakijan opas 2014
Humak: hakijan opas 2014Humak: hakijan opas 2014
Humak: hakijan opas 2014
 
Delux Auto 2009
Delux Auto 2009Delux Auto 2009
Delux Auto 2009
 
Fasttrack
FasttrackFasttrack
Fasttrack
 
Blu as presentation
Blu as presentationBlu as presentation
Blu as presentation
 
Koordinaatti.fi - Humak: nuorten tieto- ja neuvontatyön päämäärät / JF 16.9.13
Koordinaatti.fi - Humak: nuorten tieto- ja neuvontatyön päämäärät / JF 16.9.13Koordinaatti.fi - Humak: nuorten tieto- ja neuvontatyön päämäärät / JF 16.9.13
Koordinaatti.fi - Humak: nuorten tieto- ja neuvontatyön päämäärät / JF 16.9.13
 

Semelhante a .htaccess Cheatsheet

12 Rocking Apache .htaccess Tutorial ...
12 Rocking Apache .htaccess Tutorial ...12 Rocking Apache .htaccess Tutorial ...
12 Rocking Apache .htaccess Tutorial ...wensheng wei
 
Securing your Movable Type installation
Securing your Movable Type installationSecuring your Movable Type installation
Securing your Movable Type installationSix Apart KK
 
ApacheConNA 2015: What's new in Apache httpd 2.4
ApacheConNA 2015: What's new in Apache httpd 2.4ApacheConNA 2015: What's new in Apache httpd 2.4
ApacheConNA 2015: What's new in Apache httpd 2.4Jim Jagielski
 
What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24Jim Jagielski
 
Apache HTTPD 2.4 - GWO2016
Apache HTTPD 2.4 - GWO2016Apache HTTPD 2.4 - GWO2016
Apache HTTPD 2.4 - GWO2016Jim Jagielski
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzenWalter Ebert
 
Apache Server Tutorial
Apache Server TutorialApache Server Tutorial
Apache Server TutorialJagat Kothari
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019Anam Ahmed
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1Wataru OKAMOTO
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSSiddharth Ram Dinesh
 
WordPress MU 101
WordPress MU 101WordPress MU 101
WordPress MU 101Pete Mall
 
How to Block folders access in Wordpress
How to Block folders access in WordpressHow to Block folders access in Wordpress
How to Block folders access in WordpressDavid Rajah Selvaraj
 
Mod deflate setup and testing
Mod deflate setup and testingMod deflate setup and testing
Mod deflate setup and testingmytunee
 

Semelhante a .htaccess Cheatsheet (20)

12 Rocking Apache .htaccess Tutorial ...
12 Rocking Apache .htaccess Tutorial ...12 Rocking Apache .htaccess Tutorial ...
12 Rocking Apache .htaccess Tutorial ...
 
Securing your Movable Type installation
Securing your Movable Type installationSecuring your Movable Type installation
Securing your Movable Type installation
 
ApacheConNA 2015: What's new in Apache httpd 2.4
ApacheConNA 2015: What's new in Apache httpd 2.4ApacheConNA 2015: What's new in Apache httpd 2.4
ApacheConNA 2015: What's new in Apache httpd 2.4
 
What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24
 
Apache httpd v2.4
Apache httpd v2.4Apache httpd v2.4
Apache httpd v2.4
 
Apache HTTPD 2.4 - GWO2016
Apache HTTPD 2.4 - GWO2016Apache HTTPD 2.4 - GWO2016
Apache HTTPD 2.4 - GWO2016
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzen
 
Apache Server Tutorial
Apache Server TutorialApache Server Tutorial
Apache Server Tutorial
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OS
 
WordPress MU 101
WordPress MU 101WordPress MU 101
WordPress MU 101
 
How to block a file in cpanel?
How to block a file in cpanel?How to block a file in cpanel?
How to block a file in cpanel?
 
How to Block folders access in Wordpress
How to Block folders access in WordpressHow to Block folders access in Wordpress
How to Block folders access in Wordpress
 
Mod deflate setup and testing
Mod deflate setup and testingMod deflate setup and testing
Mod deflate setup and testing
 
are available here
are available hereare available here
are available here
 
Apache Web Server Setup 3
Apache Web Server Setup 3Apache Web Server Setup 3
Apache Web Server Setup 3
 
MTDDC Tokyo 2011
MTDDC Tokyo 2011MTDDC Tokyo 2011
MTDDC Tokyo 2011
 
Download It
Download ItDownload It
Download It
 
Apache Cheat Sheet
Apache Cheat SheetApache Cheat Sheet
Apache Cheat Sheet
 

Último

Diligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsDiligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsTILDEN
 
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...SUHANI PANDEY
 
Balaji Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Balaji Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Balaji Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Balaji Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Western Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 PresentationWestern Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 PresentationPaul West-Sells
 
Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024TeckResourcesLtd
 
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...SUHANI PANDEY
 
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...mriyagarg453
 
AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024gstubel
 
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Corporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdfCorporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdfProbe Gold
 
Terna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results PresentationTerna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results PresentationTerna SpA
 
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Marunji Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024CollectiveMining1
 
High Profile Call Girls in Pune (Adult Only) 8005736733 Escort Service 24x7 ...
High Profile Call Girls in Pune  (Adult Only) 8005736733 Escort Service 24x7 ...High Profile Call Girls in Pune  (Adult Only) 8005736733 Escort Service 24x7 ...
High Profile Call Girls in Pune (Adult Only) 8005736733 Escort Service 24x7 ...SUHANI PANDEY
 
Vijayawada ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready F...
Vijayawada ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready F...Vijayawada ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready F...
Vijayawada ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready F...tanu pandey
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024CollectiveMining1
 
Teekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings PresentationTeekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings PresentationTeekay Tankers Ltd
 

Último (20)

Diligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsDiligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage Startups
 
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Parvati Gaon WhatSapp Number 8005736733 With Elite Staff...
 
(INDIRA) Call Girl Kashmir Call Now 8617697112 Kashmir Escorts 24x7
(INDIRA) Call Girl Kashmir Call Now 8617697112 Kashmir Escorts 24x7(INDIRA) Call Girl Kashmir Call Now 8617697112 Kashmir Escorts 24x7
(INDIRA) Call Girl Kashmir Call Now 8617697112 Kashmir Escorts 24x7
 
Balaji Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Balaji Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Balaji Nagar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Balaji Nagar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Kheda 7001035870 Whatsapp Number, 24/07 Booking
 
Western Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 PresentationWestern Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 Presentation
 
Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024
 
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...
VVIP Pune Call Girls Sopan Baug WhatSapp Number 8005736733 With Elite Staff A...
 
Call Girls in Panjabi Bagh, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Panjabi Bagh, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Panjabi Bagh, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Panjabi Bagh, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Ambala Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024
 
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Junagadh 7001035870 Whatsapp Number, 24/07 Booking
 
Corporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdfCorporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdf
 
Terna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results PresentationTerna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results Presentation
 
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Marunji Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Marunji Call Me 7737669865 Budget Friendly No Advance Booking
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024
 
High Profile Call Girls in Pune (Adult Only) 8005736733 Escort Service 24x7 ...
High Profile Call Girls in Pune  (Adult Only) 8005736733 Escort Service 24x7 ...High Profile Call Girls in Pune  (Adult Only) 8005736733 Escort Service 24x7 ...
High Profile Call Girls in Pune (Adult Only) 8005736733 Escort Service 24x7 ...
 
Vijayawada ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready F...
Vijayawada ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready F...Vijayawada ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready F...
Vijayawada ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready F...
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024
 
Teekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings PresentationTeekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings Presentation
 

.htaccess Cheatsheet

  • 1. .htaccess Cheatsheet Enable Directory Browsing Options +Indexes ## block a few types of files from showing IndexIgnore *.wmv *.mp4 *.avi Disable Directory Browsing Options All -Indexes Customize Error Messages ErrorDocument 403 /forbidden.html ErrorDocument 404 /notfound.html ErrorDocument 500 /servererror.html Get SSI working with HTML/SHTML AddType text/html .html AddType text/html .shtml AddHandler server-parsed .html AddHandler server-parsed .shtml # AddHandler server-parsed .htm Change Default Page (order is followed!) DirectoryIndex myhome.htm index.htm index.php Block Users from accessing the site <limit GET POST PUT> order deny,allow deny from 202.54.122.33 deny from 8.70.44.53 deny from .spammers.com allow from all </limit> Allow only LAN users order deny,allow deny from all allow from 192.168.0.0/24 Redirect Visitors to New Page/Directory Redirect oldpage.html http://www.domainname.com/newpage.html Redirect /olddir http://www.domainname.com/newdir/
  • 2. Block site from specific referrers RewriteEngine on RewriteCond %{HTTP_REFERER} site-to-block.com [NC] RewriteCond %{HTTP_REFERER} site-to-block-2.com [NC] RewriteRule .* - [F] Block Hot Linking/Bandwidth hogging RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC] RewriteRule .(gif|jpg)$ - [F] Want to show a “Stealing is Bad” message too? Add this below the Hot Link Blocking code: RewriteRule .(gif|jpg)$ http://www.mydomain.com/dontsteal.gif [R,L] Stop .htaccess (or any other file) from being viewed <files file-name> order allow,deny deny from all </files> Avoid the 500 Error # Avoid 500 error by passing charset AddDefaultCharset utf-8 Grant CGI Access in a directory Options +ExecCGI AddHandler cgi-script cgi pl # To enable all scripts in a directory use the following # SetHandler cgi-script Enable Gzip – Save Bandwidth # BEGIN GZIP <ifmodule mod_deflate.c> # Combine the below two lines - I've split it up for presentation AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </ifmodule> # END GZIP
  • 3. Turn off magic_quotes_gpc # Only if you use PHP <ifmodule mod_php4.c> php_flag magic_quotes_gpc off </ifmodule> Set an Expires header and enable Cache-Control <ifmodule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType text/html "access plus 7200 seconds" ExpiresByType image/gif "access plus 518400 seconds" ExpiresByType image/jpeg "access plus 518400 seconds" ExpiresByType image/png "access plus 518400 seconds" ExpiresByType text/css "access plus 518400 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" </ifmodule> <ifmodule mod_headers.c> # Cache specified files for 6 days <filesmatch ".(ico|flv|jpg|jpeg|png|gif|css|swf)$"> Header set Cache-Control "max-age=518400, public" </filesmatch> # Cache HTML files for a couple hours <filesmatch ".(html|htm)$"> Header set Cache-Control "max-age=7200, private, must-revalidate" </filesmatch> # Cache PDFs for a day <filesmatch ".(pdf)$"> Header set Cache-Control "max-age=86400, public" </filesmatch> # Cache Javascripts for 2.5 days <filesmatch ".(js)$"> Header set Cache-Control "max-age=216000, private" </filesmatch> </ifmodule>