Skip to content

Instantly share code, notes, and snippets.

View benlilley's full-sized avatar

Ben Lilley benlilley

View GitHub Profile
@benlilley
benlilley / .htaccess
Created April 22, 2018 22:47
Default Craft CMS .htaccess
# ----------------------------------------------------------------------
# | Cleaning URLs |
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
# Remove www from URL's
RewriteCond %{HTTP_HOST} ^www\.(.+)
# RewriteCond %{HTTPS}s/%1 ^(on(s)|offs)/(.+)
RewriteRule ^ http%2://%3%{REQUEST_URI} [L,R=301]
@benlilley
benlilley / gist:3161400
Created July 22, 2012 23:43
JavaScript: Write Browser Information To Form Input
$("#browser").val(navigator.userAgent);
# turn on mod_rewrite
RewriteEngine On
RewriteBase /
# ensure our url always has www
RewriteCond %{http_host} ^blahblah.co.nz
RewriteRule ^(.*)$ http://www.blahblah.co.nz/$1 [R=301,L]
# make sure index.php is always removed from url
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php(/[^\s\?]+)? [NC]
@benlilley
benlilley / ExpressionEngine 1 » 2 Upgrade
Created July 11, 2011 05:25
My rough draft of the ExpressionEngine 1 » 2 upgrade process.
- Update all Modules, Extensions & Fieldtypes to latest versions.
- Uninstall Structure, Publish Tweaks & Safe Segments, Low NoSpam.
- LG Better Meta - http://ee-garage.com/nsm-better-meta/user-guide#toc-updating_lg_better_meta
- Plan the nGen File Field SQL Queries. Example below.
- Change all nGen fields to 'text' to ensure data isn't loss..
- Templates to DB manually turn off save as file and update.
- Remove all Cache.
- Back Up everything.
- Update to EE2.
- Updated all Modules & Extensions to EE2 versions.