[Linux-disciples] RewriteRule

Adam Kessel linux-disciples@bostoncoop.net
Thu, 7 Aug 2003 22:51:45 -0400


--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I don't think you *must* do it in .htaccess, but advantages are:

* Better hygiene.

* You don't need to become root every time to change it.

* You don't need to restart your server every time you change it.

You are restarting apache every time you change it, yes?

You should make sure Rewriting is working at all, so do something really
general and see if it takes effect:

RewriteRule x /cgi-bin/weblog.pl

and then go to laniels.org/x and see what you get


On Thu, Aug 07, 2003 at 10:28:11PM -0400, Stephen R Laniel wrote:
> On Thu, Aug 07, 2003 at 10:14:59PM -0400, Adam Kessel wrote:
> >=20
> > Did you remember to turn "RewriteEngine on" first? (I assume you're doi=
ng
> > this in .htaccess). And also make sure LoadModule rewrite_module is
> > uncommented in httpd.conf!
>=20
> I forgot to do the first, and remembered to do the second. Still, doing
> the first didn't fix it.
>=20
> Also, I'm doing this inside of httpd.conf, within the virtual-host block
> for laniels.org
>=20
> > Furthermore, you probably don't want that slash at the beginning of the
> > RewriteRule.  The Rewrite Engine is a little funny about what it gets
> > passed.
>=20
> Fixing this didn't improve things, unfortunately; I still get=20
>=20
> [Thu Aug  7 22:25:02 2003] [error] [client 192.168.1.1] File does not
> exist: /var/laniels.org/weblog
>=20
> > (also ? does mean '0 or 1')
>=20
> The trouble is that I'm actually trying to do two forms of shortcut:
> first, I want people to be able to use '/weblog' instead of
> '/cgi-bin/weblog', and I want them to be able to do '/weblog?foo' rather
> than '/weblog?rightframe=3Dfoo'. Hence the full RewriteRule that I'm using
> is (including the changes you suggested)
>=20
> RewriteRule ^weblog\?(.*)$ /cgi-bin/weblog?rightframe=3D$1
>=20
> Do you think moving this to .htaccess would fix things? I'll try that.
>=20
> --=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_
>=20



--=20
Adam Kessel
http://bostoncoop.net/adam

--82I3+IH0IqGh5yIs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/MxBBdTf3ZklQ6qYRArWlAJ9WtCpzhsCCWBMmRuQ8ZTgxo+Ya6gCfY4Mx
8l44LP9bo/ZAsVs8RjTUzDw=
=ewtn
-----END PGP SIGNATURE-----

--82I3+IH0IqGh5yIs--