SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
.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>

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Софит-Люкс - 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
 

Andere mochten auch (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
 

Ähnlich wie .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
 

Ähnlich wie .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
 

Kürzlich hochgeladen

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
 
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanur
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts PodanurTop Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanur
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanurdharasingh5698
 
Dattawadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...
Dattawadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...Dattawadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...
Dattawadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...tanu pandey
 
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escorts
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our EscortsVIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escorts
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escortssonatiwari757
 
Teck Investor Presentation, April 24, 2024
Teck Investor Presentation, April 24, 2024Teck Investor Presentation, April 24, 2024
Teck Investor Presentation, April 24, 2024TeckResourcesLtd
 
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
 
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
 
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
 
SME IPO and sme ipo listing consultants .pptx
SME IPO and sme ipo listing consultants .pptxSME IPO and sme ipo listing consultants .pptx
SME IPO and sme ipo listing consultants .pptxindia IPO
 
Q3 FY24 Earnings Conference Call Presentation
Q3 FY24 Earnings Conference Call PresentationQ3 FY24 Earnings Conference Call Presentation
Q3 FY24 Earnings Conference Call PresentationSysco_Investors
 
countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024Kweku Zurek
 
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Best investment platform in india-Falcon Invoice Discounting
Best investment platform in india-Falcon Invoice DiscountingBest investment platform in india-Falcon Invoice Discounting
Best investment platform in india-Falcon Invoice DiscountingFalcon Invoice Discounting
 
Diligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsDiligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsTILDEN
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024CollectiveMining1
 

Kürzlich hochgeladen (20)

Vip Call Girls Vasant Kunj ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Vasant Kunj ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Vasant Kunj ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Vasant Kunj ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
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
 
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanur
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts PodanurTop Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanur
Top Rated Call Girls In Podanur 📱 {7001035870} VIP Escorts Podanur
 
Call Girls 🫤 East Of Kailash ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ...
Call Girls 🫤 East Of Kailash ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ...Call Girls 🫤 East Of Kailash ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ...
Call Girls 🫤 East Of Kailash ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ...
 
(👉゚9999965857 ゚)👉 Russian Call Girls Aerocity 👉 Delhi 👈 : 9999 Cash Payment F...
(👉゚9999965857 ゚)👉 Russian Call Girls Aerocity 👉 Delhi 👈 : 9999 Cash Payment F...(👉゚9999965857 ゚)👉 Russian Call Girls Aerocity 👉 Delhi 👈 : 9999 Cash Payment F...
(👉゚9999965857 ゚)👉 Russian Call Girls Aerocity 👉 Delhi 👈 : 9999 Cash Payment F...
 
Dattawadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...
Dattawadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...Dattawadi ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready Fo...
Dattawadi ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready Fo...
 
Vip Call Girls South Ex ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls South Ex ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls South Ex ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls South Ex ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escorts
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our EscortsVIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escorts
VIP Amritsar Call Girl 7001035870 Enjoy Call Girls With Our Escorts
 
Teck Investor Presentation, April 24, 2024
Teck Investor Presentation, April 24, 2024Teck Investor Presentation, April 24, 2024
Teck Investor Presentation, April 24, 2024
 
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...
 
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...
 
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...
 
SME IPO and sme ipo listing consultants .pptx
SME IPO and sme ipo listing consultants .pptxSME IPO and sme ipo listing consultants .pptx
SME IPO and sme ipo listing consultants .pptx
 
Q3 FY24 Earnings Conference Call Presentation
Q3 FY24 Earnings Conference Call PresentationQ3 FY24 Earnings Conference Call Presentation
Q3 FY24 Earnings Conference Call Presentation
 
countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024
 
(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
 
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Udyog Vihar Gurgaon >༒8448380779 Escort Service
 
Best investment platform in india-Falcon Invoice Discounting
Best investment platform in india-Falcon Invoice DiscountingBest investment platform in india-Falcon Invoice Discounting
Best investment platform in india-Falcon Invoice Discounting
 
Diligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsDiligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage Startups
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024
 

.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>