1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Rep Power

    Complex htaccess rules

    Hi all,

    I've just taken control of a site (written by another developer), which has a load of unfriendly URLs that the client would like me to make 'friendly'.
    I've done this using .htaccess and mod-rewrite.

    I need to re-write URLs such as the following, but don't know how to write the rules to do so.
    An example of the type of URL I have to convert is as follows:


    Needs to become:


    'search_KEYWORD' can have a load of string values including aluminium, black, silver, steel, etc.
    'search_RANGE' can be Frames, Posters, Photos... and lots of other things
    'o' is always a numerical value, and is used to indicate which page the user is currently on.
    'search' is also numerical.

    I thought I'd need to do something like this in .htaccess:
    Redirect 301 09search_results.php?search_KEYWORD=aluminium&search_RANGE=Frames&o=1&search=1 /frames/aluminium/$1

    However I can't make this work at all. Can anyone please help?
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power

IMN logo majestic logo threadwatch logo seochat tools logo