.htaccess rules help

Hi, I'm trying to add a rule to my .htaccess file that will redirect a
request for one of a series of possible image names to a "master"
image.

Example:

http://www.domain.com/images/lemonslice_up_01.jpg

to

http://www.domain.com/images/lemonslice.jpg

where the '_up_01' will vary (i.e. _down_01, _up_02, etc)

I'm sure it's a two line entry in the .htaccess file but I can't quite
grasp the matching syntax they use :(

Please, anyone, save my sanity!

Cheers!
James
cashinparadise [ Mo, 05 November 2007 23:21 ] [ ID #1862791 ]

Re: .htaccess rules help

On 5 Nov., 23:21, cashinparad... [at] gmail.com wrote:
> Hi, I'm trying to add a rule to my .htaccess file that will redirect a
> request for one of a series of possible image names to a "master"
> image.
>
> Example:
>
> http://www.domain.com/images/lemonslice_up_01.jpg
>
> to
>
> http://www.domain.com/images/lemonslice.jpg
>
> where the '_up_01' will vary (i.e. _down_01, _up_02, etc)
>
> I'm sure it's a two line entry in the .htaccess file but I can't quite
> grasp the matching syntax they use :(
>
> Please, anyone, save my sanity!
>
> Cheers!
> James

not tested, should work:

RewriteEngine On
RewriteRule lemonslice([_a-z]+)([_0-9]+).jpg lemonsclice.jpg
Lammi [ Di, 06 November 2007 12:36 ] [ ID #1863736 ]

Re: .htaccess rules help

A million thanks! That was just enough information to get me started
on the path to my solution.

Cheers!

On Nov 6, 6:36 am, Lammi <Lorenz.Lammersd... [at] gmail.com> wrote:
> On 5 Nov., 23:21, cashinparad... [at] gmail.com wrote:
>
>
>
> > Hi, I'm trying to add a rule to my .htaccess file that will redirect a
> > request for one of a series of possible image names to a "master"
> > image.
>
> > Example:
>
> >http://www.domain.com/images/lemonslice_up_01.jpg
>
> > to
>
> >http://www.domain.com/images/lemonslice.jpg
>
> > where the '_up_01' will vary (i.e. _down_01, _up_02, etc)
>
> > I'm sure it's a two line entry in the .htaccess file but I can't quite
> > grasp the matching syntax they use :(
>
> > Please, anyone, save my sanity!
>
> > Cheers!
> > James
>
> not tested, should work:
>
> RewriteEngine On
> RewriteRule lemonslice([_a-z]+)([_0-9]+).jpg lemonsclice.jpg
cashinparadise [ Di, 06 November 2007 13:48 ] [ ID #1863738 ]
Webserver » alt.apache.configuration » .htaccess rules help

Vorheriges Thema: ScriptAliasMatch vs. DirectoryIndex problem
Nächstes Thema: 127.0.0.1 in access log