Hi Robert,
Very sorry .., my fault in writing the below line,
I wrote :
RedirectMatch (.*)\ .*$ https://www.domain.com/aaa$1
It should be :
RedirectMatch (.*)\ .*$ https://www.domain.com/bbb$1
My situation as an admin is,
i have to tweak the url
rewriting sequence to come up with a solution
for my apache+tomcat production server. The setting which i posted (
please consider the amendment posted today) is successfully redirecting
urls from "http://subdomain.domain.com" to
"https://www.domain.com/subdoain/" .
Now i am failing to understand one thing out of my configuration, as i
mentioned what the "$1" is functioning for, and what are deciding this
url redirect function . If you guies out here would feel interested, i
would show what changes i made for which the url redirection just
ceased to function.
I need to put a single line modify in my httpd.conf for load balancing
and that change made the url rewrite malfunction , outputing " page not
found 404 error"
Waiting for your comments ..
Thanks and regards..
Sanjay Saha
System Administrator
www.sanjaysaha.in
Robert Ionescu wrote:
> sanjay wrote:
> > RedirectMatch (.*)\ .*$ https://www.domain.com/aaa$1
> > ------x-------
>
> will never end up in
>
> > =>https://www.domain.com/bbb/index.jsp
>
> For two reasons:
> The redirect would always go to /aaa and not /bbb - this is impossible.
>
> The RegEx (.*)\ .*$ would not work and should end up in an internal
> server error. To use a space, you must use double quotes "(.*) .*$" The
> way you used escaping the space will work for mod_rewrite only.
>
> And third: Your request did not contain a space, so the regEx won't match.
>
> > Now i cann't figure out whats the function of $1 in the Redirectmatch
> > here
>
> It captures the result of the first group of the RegEx, called
> backreference. See pcre man page, http://www.pcre.org/pcre.txt
>
> --
> Robert