Skip to content

Instantly share code, notes, and snippets.

@zuf
zuf / gist:1106666
Created July 26, 2011 12:43
www to non-www redirect (mod_rewrite)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
@zuf
zuf / php_javascript_html_redirect.php
Created September 15, 2010 17:29
Complete PHP + JavaScript + HTML redirect solution
<?php
//
// Complete PHP + JavaScript + HTML redirect solution
//
$url = 'http://www.example.com/';
header("Location: $url"); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript">//<![CDATA[
location.replace("<?php echo $url; ?>");
module FormtasticExtensions
module Formtastic
module TextileEditor
def self.included(base)
base.class_eval do
@javascript_included = false
end
end