httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Pulsifer" <pulsif...@comcast.net>
Subject RE: [users@httpd] mod_rewrite and mod_jk help
Date Fri, 08 Jun 2007 18:16:07 GMT
> Now want when a user browse www.example.com/someusername/ 
> httpd will forward the request to 
> www.example.com/user/?user=someusername
> 
> And when browse a user browse 
> www.example.com/someusername/login/ httpd will forward the 
> request to www.example.com/user/login/?user=someusername
> 
> So just 'pull out' the 'someusername' and add 
> ?user=someusername at the end. Is this doable?

By "forward the request", I assume you mean "respond as if the url were X",
as opposed to "redirect the request to X via HTTP response code 301 or 302."
If so, try this:

RewriteRule ^/(.*?)/(.*)/$ /$2/?user=$1 [L]

Rewrite rules are notoriously difficult to debug.  Turning on rewrite
logging and then trying truncated versions or simplified versions of the
rule against various requests might help.  Good luck.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message