Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-19-2012, 06:23 PM   #1
Registered: Oct 2006
Posts: 297

Rep: Reputation: 31
How to add a new parameter with rewrite in Apache?


Apache/2.2/Tomcat6 on Centos 5.5.

I authenticate users in Apache using kerberos. In tomcat I can recover user using next configuration in Apache:

AuthType Kerberos
AuthName Autenticacion
require valid-user

RewriteEngine On
RewriteRule .* - [E=RU:%{REMOTE_USER}]
RequestHeader set X_REMOTE_USER %{RU}e

But I'd like to send user in a parameter:

If receive /application/login.jsp

Apache will rewrite the query and send Tomcat:


I've tried with rewrite:

RewriteEngine on
RewriteRule /application/login\.jsp /application/login.jsp?user=%{X_REMOTE_USER}e

But it doesn't work.

Whats wrong in the rule?

Old 03-26-2012, 04:49 PM   #2
Registered: Oct 2006
Posts: 297

Original Poster
Rep: Reputation: 31
Finally, I've found the solution:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^/(.*)/login\.jsp$ /$1/login.jsp?user=%{LA-U:REMOTE_USER} [PT]



apache2, rewriterule

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
add piping as parameter to a simple perl script frater Programming 5 02-03-2012 06:26 AM
Add parameter ust Linux - Newbie 3 09-09-2008 11:40 PM
apache rewrite help deesto Linux - Server 3 11-03-2006 02:07 PM
Unable to add parameter to /proc twk Red Hat 2 08-19-2006 10:52 AM
how to add -h parameter in script yulitao Programming 4 03-23-2004 07:30 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration