This would send 302, not 301 header

Isaak Malik-3 wrote:
> 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-redirect-tp17803242p17803976.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to