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