NYCPHP Meetup

NYPHP.org

[nycphp-talk] Canonical hostname help

Cliff Hirsch cliff at pinestream.com
Wed Dec 5 13:58:50 EST 2007


If I want to redirect domain.com to www.domain.com (or for that matter
anything.domain.com to www.domain.com I have figured out (but not tested)
the following so far:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L, R=301]
</IfModule> 

But what about https? How can I make the redirect work for both http and
https transactions, redirecting http to http and https to https?

Cliff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071205/4c958858/attachment.html>


More information about the talk mailing list