httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Smallacombe>
Subject Re: [users@httpd] RewriteCond question
Date Thu, 18 Feb 2010 23:14:33 GMT
On Thu, 18 Feb 2010, John Oliver wrote:

> I'm dealing with a site that is accessed via  The
> certificate is for ""  I akready have a working rule to catch
> and rewrite to  I also got
> caught and rewritten with:
> RewriteCond %{http_host} ^www\.domain\.gov [NC]
> RewriteRule ^(.*)$$1 [R=301]
> However, attempts to access are still an issue.
> I tried:
> RewriteCond %{https} ^www\.domain\.gov [NC]
> RewriteRule ^(.*)$$1 [R=301]
> But that didn't work (I didn't really expect it to, but it was worth a
> try!)
> What magic sauce do I need to catch and rewrite that attempt?

I just dealt with a similar issue regarding two different certificates. 
Try this:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} ^www\.domain\.gov$ [NC]
RewriteRule ^(.*)$$ [R=301,NC]

James Smallacombe		      PlantageNet, Inc. CEO and Janitor	

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message