httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] How to rewrite specific URL to use https
Date Thu, 19 Jul 2007 15:22:20 GMT
On 7/19/07, Ted Fines <> wrote:

> Can you clarify "add [L] to the flags on your redirect"?   Do you mean the
> one that does lowercase, or the https one?

The https one, since you don't need to lowercase if you are going to redirect.

> I tried:
> RewriteEngine on
> RewriteLogLevel 0
> RewriteLog
> "/usr/local/apache/logs/"
> RewriteMap  lowercase int:tolower
> RewriteCond $1 [A-Z]
> RewriteRule (.*) ${lowercase:$1} [PT]
> RewriteCond %{SERVER_PORT} !^443$
> RewriteCond %{REQUEST_URI} ^/restricted(.*)$ [NC]
> RewriteRule ^/restricted(.*)$
> And this seems to work.  It correctly rewrites URLs to lowercase, and now
> all reqs to /restricted get rewritten as https.
> I do not understand why this doesn't work when "RewriteCond $1 [A-Z]" is
> removed.  If you can clarify that, great, but the problem appears to be
> solved now, thank you!

I'm not sure exactly what the problem is. What exactly happens when
you use this config? What is in the RewriteLog?

By the way, the RewriteCond on the REQUEST_URI shouldn't be necessary,
since it repeats the same restriction that is imposed by the


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