[users@httpd] Validity of regex in mod_alias context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Apache httpd users,

I have just subscribed to this list to clarify a few things for
me that so far 
I couldn't find in the abundance of Apache and its modules'
refeernce and howto 
material.
Probably something like this has been asked a million of times
here and thus already
found sufficient coverage in the FAQs or similar list annals.

Although I am quite sure that what I try to achieve can easily be
handled by
mod_rewrite I hesitate pulling in this module's heavy regex
parser as it sort of
seems like overkill to me for such a trivial task.

Inspite, I have the supicion that the more light weight mod_alias
could equally well come
to rescue.

I have a URI (i.e. Alias) whose <Directory> container should
include an SSLRequireSSL
to enforce SSL/TLS for clients' access.

However, instead of the browser merely returning a forbidden
statement I'd rather
like to redirect any http request into a https request to the
same URI.

That's why I thought up this

        <IfModule mod_alias.c>
            RedirectMatch 301 ^(?:[[:alpha:]]+://)?(.*)
https://$1
        </IfModule>


But it doesn't work, and neither the httpd's access_log nor
error_log (or their ssl_ namesakes)
show up any hint why.

In mod_alias'es reference doc I couldn't find a note on what kind
of regex classes are valid
(e.g. simple ones like the Unix sed uses, or more advanced like
Perl's e.g. \w).
Probably the [:alpha:] isn't recognised at all.

Or could I refer to some server's environment variables like
%{PROTO} (if such exists at all?)
Where would I find a list of all httpd env vars?

Regards
Ralph

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux