mod_rewrite Help!

mod_rewrite Help!

Post by Sean Abraha » Fri, 20 Sep 2002 04:01:04



I seriously need help here. Running Debian testing, Apache 1.3.26,
mod_rewrite DSO.

Trying to strip a session ID from the URL. URL looks like this:

http://www.veryComputer.com/~sean/blah/6ceae128bd605b0a/sess.cgi

You get this URL by going to a login page and entering your userid and
password. I'm stripping the "6ceae128bd605b0a" from the URL and
passing it as SESSION http header to
http://www.veryComputer.com/~sean/blah/sess.cgi. Here's my current rule
in my .htaccess file (no virtual host info configured in httpd):

Rewri*gine on
RewriteBase /~sean/blah
RewriteRule ^([A-Fa-f0-9]{16})/(.*) $2 [E=SESSION:$1]

This succeeds in striping the ID and loading
http://www.veryComputer.com/~sean/blah/sess.cgi, but it doesn't pass the form
userid and password values. Is this due to the Internal Redirect? How
do I do this without redirecting? It's very slow.

Here's my rewrite.log:

[30/Aug/2002:13:25:25 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] strip per-dir prefix:
/home/sean/public_html/blah/sess.cgi -> sess.cgi
[30/Aug/2002:13:25:25 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] applying pattern
'^([A-Fa-f0-9]{16})/(.*)' to uri 'sess.cgi'
[30/Aug/2002:13:25:25 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (1) [per-dir
/home/sean/public_html/blah/] pass through
/home/sean/public_html/blah/sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] add path-info postfix:
/home/sean/public_html/blah/6ceae128bd605b0a ->
/home/sean/public_html/blah/6ceae128bd605b0a/sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] strip per-dir prefix:
/home/sean/public_html/blah/6ceae128bd605b0a/sess.cgi ->
6ceae128bd605b0a/sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] applying pattern
'^([A-Fa-f0-9]{16})/(.*)' to uri '6ceae128bd605b0a/sess.cgi'
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (2) [per-dir
/home/sean/public_html/blah/] rewrite 6ceae128bd605b0a/sess.cgi ->
sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (3) [per-dir
/home/sean/public_html/blah/] add per-dir prefix: sess.cgi ->
/home/sean/public_html/blah/sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (2) [per-dir
/home/sean/public_html/blah/] trying to replace prefix
/home/sean/public_html/blah/ with /~sean/parking
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81f4444/initial] (1) [per-dir
/home/sean/public_html/blah/] internal redirect with
/~sean/parking/sess.cgi [INTERNAL REDIRECT]
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81fc654/initial/redir#1] (3) [per-dir
/home/sean/public_html/blah/] strip per-dir prefix:
/home/sean/public_html/blah/sess.cgi -> sess.cgi
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81fc654/initial/redir#1] (3) [per-dir
/home/sean/public_html/blah/] applying pattern
'^([A-Fa-f0-9]{16})/(.*)' to uri 'sess.cgi'
[30/Aug/2002:13:25:27 -0700]
[blah.net/sid#8088f64][rid#81fc654/initial/redir#1] (1) [per-dir
/home/sean/public_html/blah/] pass through
/home/sean/public_html/blah/sess.cgi

Thanks,
--Sean

 
 
 

1. mod_vhost_alias or mod_rewrite help needed.

Hi,

Example virtualhost
<VirtualHost 10.180.68.64>
  ServerName www.domain.com
  ServerAlias domain.com
  ServerAlias www.anotherdomain.com
  DocumentRoot /home/users/corgrjar
  ScriptAlias /cgi-bin/ /home/users/corgrjar/cgi-bin/
  User corgrjar
  Group webusers
</VirtualHost>

I want to use mod_vhost and or mod_rewrite to change directory
layout and to minimize the memory usage/startup time of apache and to
have a nicer diretory structure.

This is how far I have come:
<VirtualHost 10.180.68.64>
       ServerName www.domain.com
       CustomLog logs/access_log.mvhost vcommon
       VirtualDocumentRoot /virtualhosts/%2.1/%0/
       VirtualScriptAlias  /virtualhosts/%2.1/%0/cgi-bin
</VirtualHost>

The DocumentRoot would be: /virtualhosts/d/www.domain.com/
But then I have this problem with ServerAliases. I could
make a symlink for www.anotherdomain.com in
/virtualhosts/a/www.anotherdomain.com -> ../d/www.domain.com/
But that would be _alot_ of symlinks.

So my question is if you could have a file with the ServerAliases
assosiated with the path or similar and rewrite it to the
ServerName directory. And to make it even more complex a domain
(ServerName) can have more than one ServerAlias assosiated with it.

Has anyone done this? Is it possible?

Greetings from Sweden.
./fs

2. icons in Fvwm2Buttons

3. mod_rewrite help (maybe?)

4. Compressing logfiles on the fly?

5. MOD_Rewrite Help Needed....

6. Install problem with Mandrake 7.0

7. mod_rewrite help

8. inexpensive notebook/laptop?

9. mod_rewrite help ?

10. Apache1.3.6 Reverse Proxy mod_rewrite help!

11. mod_rewrite HELP!.