.htaccess rules help

This is a discussion on .htaccess rules help within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I'm trying to add a rule to my .htaccess file that will redirect a request for one of ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-05-2007
cashinparadise@gmail.com
 
Posts: n/a
Default .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

  #2 (permalink)  
Old 11-06-2007
Lammi
 
Posts: n/a
Default Re: .htaccess rules help

On 5 Nov., 23:21, cashinparad...@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

  #3 (permalink)  
Old 11-06-2007
cashinparadise@gmail.com
 
Posts: n/a
Default 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...@gmail.com> wrote:
> On 5 Nov., 23:21, cashinparad...@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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0