February 13th, 2012, 07:52 AM
Complex htaccess rules
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?
February 13th, 2012, 08:35 AM