Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Peter Cooperx http://www.petercooper.co.uk/

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Parse HTML files as PHP

Add this to your .htaccess file in Apache:

   1  AddType application/x-httpd-php .html

Prevent yourself from getting Slashdotted

Assuming you have mod_rewrite and AllowOverride activated, throw this in the .htaccess file for the directory you don't want to be Slashdotted:

   1  RewriteEngine On
   2  RewriteCond %{HTTP_REFERER} ^.*slashdot.*$
   3  RewriteRule .* - [F]


This all assumes the editors actually check the links before posting the story, but this should reasonably mean no-one on Slashdot can link to you, even if it's a bit over the top.
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS