mod_rewrite
Joshua R. Altemoos
joshua at gnu-linux.net
Mon Feb 9 20:24:11 EST 2004
Well for my website i use a get command in a php code that for example you
say http://somesite/?pg=contact it would load
/to/web/path/include/contact.txt If you want this code just e-mail me @
joshua at gnu-linux.net
Have A Good Day,
Josh
On Mon, 9 Feb 2004, Mike Richardson wrote:
> Brad Bartram wrote:
> > Hey everyone -
> >
> > I need some assistance with a mod_rewrite rule for Apache that for some reason
> > I just cannot get working. Hopefully someone here has some insight.
> >
> > I have a url:
> >
> > www.somedomain.com/directory/appname.ext?var1=val1&var2=val2
> >
> > What I need to do is take any request destined for:
> >
> > www.somedomain.com/directory/whatever.ext
> >
> > and have it sent to:
> >
> > www.somedomain.com/directory/index.php?appname=appname&var1=val1&var2=val2
> >
> > That way appname is another variable that is appended to the end of the
> > request.
>
> Although I don't see how whatever.ext is supposed to be redirected to
> index.php, I can give you some pointers:
>
> http://www.engelschall.com/pw/apache/rewriteguide/
>
>
> We use something similar to this in our site
> RedirectMatch ^/assets/images/(.*)\.(.*)$ /images/$1.$2
>
> where /assets/images/img1.gif --> /images/img1.gif
> (note use of regular expressions: very handy)
>
> Might be helpful. You'd want to match everything but index.php
> (otherwise index.php will redirect to itself infinitely)
>
> Hope this helps!
>
> --
> Mike Richardson
> Unix/Linux Administrator - Web Developer
> School of Pharmacy and Pharmaceutical Sciences
> University at Buffalo
>
>
More information about the nflug
mailing list