Why not just simply use:
<?php
if ( !preg_match('/^www\./i', $_SERVER['HTTP_HOST']) )
header('Location: http://www.example.com'); <http://www.example.com/>
?>
On Thu, Jun 12, 2008 at 5:40 PM, Scott Lively <[EMAIL PROTECTED]> wrote:
> How would you do a 301 redirect like the following?
>
>
>
> http://example.com to
>
> http://www.example.com
>
>
>
> I've tried adding the following to my .htaccess file:
>
>
>
> RewriteEngine on
>
> rewritecond %{http_host} ^example.com [nc]
>
> rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
>
>
>
> yet I get 400 Bad Request error.
>
>
>
> Does this need to be done somewhere in the Zend_Controller?
>
>
>
> Thanks,
>
>
>
> Scott Lively
>
>
>
--
Isaak Malik
Web Developer