Initial Commit

This commit is contained in:
2013-02-08 20:18:32 +00:00
commit eaaf97ef7e
61 changed files with 3375 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
class HtRule_Rule_FromWWW extends HtRule
{
public static function GetName()
{
return 'Redirect from www.';
}
public function RequireRewriteEngine()
{
return True;
}
public function __construct()
{
$this->AddParam(new HtRule_Param('domain', 'Domain Name', HtRule_Param::TYPE_STRING, 'domain.com', 'The domain without the www'));
$this->AddParam(new HtRule_Param('https', 'Use Https', HtRule_Param::TYPE_BOOLEAN, False, 'Redirect to https'));
parent::__construct();
}
public function __toString()
{
$domain = $this->params['domain']->Value();
$name = self::GetName();
$proto = 'http';
if ($this->params['https']->Value())
$proto = 'https';
return <<<EOT
# $name
RewriteCond %{HTTP_HOST} ^www.${domain}$
RewriteRule (.*) ${proto}://${domain}/$1 [R=301,L]
EOT;
}
}