Skip to content

Instantly share code, notes, and snippets.

View CharlesHenry's full-sized avatar

Charles Henry CharlesHenry

  • London
View GitHub Profile
@mudge
mudge / .htaccess
Created November 7, 2008 14:48
Remove file extensions in URLs with mod_rewrite but preserve 404 errors.
# The following will allow you to use URLs such as the following:
#
# example.com/anything
# example.com/anything/
#
# Which will actually serve files such as the following:
#
# example.com/anything.html
# example.com/anything.php
#
@cam-gists
cam-gists / seo.php
Created August 20, 2012 15:35
APACHE: Codeigniter - SEO
### Please read description below : the following .htaccess file isn't enough ###
# 1. Activate URL rewriting
RewriteEngine On
# 2. If the base folder is different from /
#RewriteBase /xyz
# 3.a. Removes the "www" ...
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
@weavenet
weavenet / delete_all_object_versions.sh
Created May 4, 2015 05:21
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`