[Linux-disciples] RewriteRule
Stephen R Laniel
linux-disciples@bostoncoop.net
Fri, 8 Aug 2003 14:40:51 -0400
--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Aug 07, 2003 at 11:19:59PM -0400, Adam Kessel wrote:
> Some day you will regret sudoing frequently. Mark my words.
Have you ever been harmed in this way?
> Fixed:
> http://laniels.org/altbblahntah
>=20
> You need to put [R] after the RewriteRule apparently because of the way
> you've got your aliases set up.
Thanks for that. It definitely works (http://laniels.org/blah), but I
can't seem to get it to work with the weblog?file substitution. I've
copied my virtual-host block below. I still get the error that Apache
things 'http://laniels.org/weblog' refers to a file called 'weblog' in
DocumentRoot.
The trouble seems to come down to the '?file' chunk, because (as you can
see below, and you can see by visiting
http://laniels.org/weblog?rightframe=3Dvideophones) the substitution
'^/weblog http://laniels.org/cgi-bin/weblog' seems to work fine - and
works perfectly file even with arguments passed to the weblog. I escaped
the '?' so that it wouldn't be confused with the '?' regex character; the
mod_rewrite manual says this is okay: visit
http://httpd.apache.org/docs/mod/mod_rewrite.html#InternalRuleset and
search for the word 'slosh' (a typo in the documentation) if you need
proof. Maybe the backreferencing works differently than I thought it did.
<VirtualHost *>
RewriteEngine On
ScriptAlias /cgi-bin/ /home/slaniel/public_html/cgi-bin/
CustomLog /var/log/apache/access.log combined env=3D!dontlog
ServerName www.laniels.org
ServerAlias laniels.org
ServerAlias laniel.hn.org
ServerAdmin webmaster@laniels.org
DocumentRoot /var/laniels.org/
RewriteRule ^/weblog http://laniels.org/cgi-bin/weblog [R]
#RewriteRule ^/weblog\?(.*)$ http://laniels.org/cgi-bin/weblog?rightframe=
=3D$1 [R]
RewriteRule blah http://laniels.org/cgi-bin/weblog [R]
Redirect /cgi-bin/show.pl http://laniels.org/cgi-bin/salonify
Options FollowSymLinks
</VirtualHost>
--=20
``Nothing gelds a novice father's masculinity more efficiently than
having to publicly verbalize a litany of cute product names each
ending in `y' or `ies' - `Huggy Furry Yummy Chewy Cuddly Potties.'''
-Mark Leyner, _Tooth Imprints On A Corn Dog_
--wac7ysb48OaltWcw
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE/M+6zHa1lzVGot+YRAqRwAJ4k+SeUetx5c0WZ8iEK6Cu83j3FOQCfe8di
YK520Q+PUrSBm9BKgH+zmcc=
=xn4p
-----END PGP SIGNATURE-----
--wac7ysb48OaltWcw--