Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2005, 12:34 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default mod_jk + apache + mod_rewrite

Hi there,

I have managed to get apache and tomcat working together fine except for one thing in the mod_rewrite.

here is my mod_rewrite bi in http.conf
[...]
RewriteEngine on

RewriteRule "^/file(.*)$" "/dir/servlet/file$1" [R,L]
RewriteCond "%{SERVER_PORT}" "^80$"
RewriteRule "^(.*)$" "https://%{SERVER_NAME}$1" [R,L]
[...]

that works fine. Except that the URL is redirected (R flag) which I don't wan't.
If I use
RewriteRule "^/file(.*)$" "/dir/servlet/file$1" [L]
alone it works fine but if I use it with the HTTPS redirect then the URL rewriting is visible to the user

http://server.domain/file.whatever?key=value

becomes

https://server.domain/dir/servlet/fi...ever?key=value

It would like it to be
https://server.domain/file.whatever?key=value

I have tried to change my rewriting rules to
RewriteCond "%{SERVER_PORT}" "^80$"
RewriteRule "^(.*)$" "https://%{SERVER_NAME}$1" [R,L]
RewriteRule "^/file(.*)$" "/dir/servlet/file$1" [PT,L]

but no matter wich way I turn it mod_jk doesn't take it. (Apache return a 403 error on the file name). I have to use the R flag to make it work.

As I said earlier
RewriteRule "^/file(.*)$" "/dir/servlet/file$1" [L]
works fine and the URLs
http://server.domain/file.whatever?key=value
are handled by tomcat.

I don't what I am missing out and doing wrong....

Hope this makes sense.
Any suggestions or pointer is mostly appreciated.

Regards
Fanch
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mod_rewrite heerajee Pro PHP 1 March 8th, 2006 06:35 AM
Apache mod_rewrite() anshul Linux 2 October 14th, 2005 09:09 AM
apache virtual server, mod_jk, tomcat 5 curiousmind Apache Tomcat 1 May 17th, 2005 09:44 AM
RedHat 9, Apache, Tomcat, mod_jk pzh19z Apache Tomcat 0 January 2nd, 2004 12:17 PM



All times are GMT -4. The time now is 06:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.