httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günter Hipler <>
Subject [users@httpd] Re: mod_rewrite in conjunction with mod_jk
Date Tue, 04 Dec 2012 07:54:39 GMT

I solved it by myself - catching a glimpse through a book and sleeping a

a) not used backreferences in RewriteRule
-> I used the wrong syntax for backreferences $1 instead of %1 for
backreferences to RewriteCond
b) no activation of RewriteRule within a more general container as .htaccess
-> For my use case I had to use the Location container instead of the
Directory or server context

Sorry for the trash and best wishes




I have to rewrite the URL:[4]&v=nose&l=de

which should be shortened and afterwords look like this
(without the IN+[4] part)

I used the following condition/Rule (in .htaccess):

RewriteCond %{REQUEST_URI} ^/TouchPoint/perma\.do
RewriteCond %{QUERY_STRING} q=(.*?)(IN.*?)&v=(.*?)
#RewriteRule ^.*$$1&v=$3 [NE,R=301]
RewriteRule ^.*$$1&v=$3 [NE,R=301]

which rewrites the request to:
As a result, the backreferences are not used in the RewriteRule

My first question: Why?

On my way I had to learn, that .htaccess is the last trigger in the apache
chain and mod_jk is used before.  JKMount directives are processed before
the rules in .htaccess.

Now I have the problem, that using the rule above in the Directory context
it is never fired. I don't understand why...

<Directory "/srv/www/htdocs">
        Options None
        AllowOverride All
        Order allow,deny
        Allow from all
        Options FollowSymLinks
      RewriteEngine On

RewriteCond %{REQUEST_URI} ^/TouchPoint/perma\.do
RewriteCond %{QUERY_STRING} q=(.*?)(IN.*?)&v=(.*?)
RewriteRule ^.*$$1&v=$3 [NE,R=301]


As a result
isn't rewrited to
(as it is in .htaccess)

I don't understand why...

Thanks for any hint!

Günter Hipler

View raw message