Re: [users@httpd] Using mod_rewrite with mod_jk2

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

 



Still having the same problem... right now my rewrite stuff looks like this - 

LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{HTTP_HOST} (.*).mysite.com$
RewriteRule /profile/aboutme
	http://mysite.com/profile/aboutme/index.jsp?memberName=%N [L]

And then when I enter "someuser.mysite.com/profile/aboutme" I get a
404 and the error logs look like this -

"File does not exist: C:/apache_web/profile/aboutme/index.jsp"

So it looks to me like the rewrite rule is doing what it's supposed
to, it's the jk2 that is the problem. Just to reiterate, I need Tomcat
to handle "/profile/aboutme/index.jsp." It seems to me that Apache is
looking for it in the document root.

On 8/11/05, Dan <lists@xxxxxxxxxxx> wrote:
> RewriteRule will by default only match the request, that is the "/
> profile" part. Apparently the RewriteRule can back-reference to the
> last-matched RewriteCond. So the following *should* work.
> 
> Of course, mod_rewrite is called "voodoo" even by experts, so it's
> possible that my logic is flawed.
> 
> In any case, you can try:
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST}  (.*).mysite.com$
> RewriteRule /profile http://mysite.com/profile.jsp?u=%N [L]
> 
> HTH
> 
> Dan
> 
> 
> On 12/08/2005, at 8:28 AM, brian papa wrote:
> 
> > I'm trying to set it up so that users of my site can enter a url like
> > "username.mysite.com/profile" that will rewrite to
> > "mysite.com/profile.jsp?u=username", or something of that nature. From
> > what I understand, using mod_rewrite is the best way to do this.
> >
> > I've added the following to my httpd.conf file -
> >
> > RewriteEngine on
> > RewriteRule (some reg exp)        /mysite.com/profile.jsp?u=($1)
> >
> > I'm using mod_jk2, which is configured so that any url request made to
> > apache that ends with ".jsp" will be handed off to Tomcat.
> >
> > The problem is, when my rewrite rule executes, the
> > /mysite.com/profile.jsp?u=($1) isn't handed off to Tomcat. Instead,
> > apache looks for a file called /mysite.com/profile.jsp located in my
> > document root! Obviously not what I desire to happen.
> >
> > I've seen sites posting solutions to related problems, saying I should
> > change the order of loading in httpd.conf for mod_rewrite and mod_jk2.
> > But that didn't change anything. Can somebody please tell me what I've
> > done wrong here?
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
> 
> 
> ---------------------------------------------------------------------
> 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
> 
>

---------------------------------------------------------------------
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