Need some URL rewriting assistance! ;)

Associate
Joined
15 Feb 2006
Posts
1,872
Location
hell
Hey,

I'm trying to make it so that my www.mydomain.com/categorypage?variable=whatever can be found via:

www.mydomain.com/whatever-randomword


I've been trying different mod rewrite commands but am not getting any luck. I think the issue is with having a random word at the end of my "clean URL".


Does anyone have some code already prepared that works in a similar way? all the mod rewrite examples online just have really simple scenarios.



Cheers
 
user23977_pic984_1211854433.jpg
 
Random word is for example:


mydomain.com/audi-cars where "cars" is the random word, basically i'm writing these manually into the page. The only variable I want to pass through would be "audi".
 
Why no just redirect everything to a script and let the script deal with sorting out there actual url.
 
My scriping isn't too good.

I was quite keen on sorting this using the .htaccess though.

Took me ages but I finally did it!

RewriteRule ^(.*)-randomword categorypage.php?brand=$1 [L]

this code seems to work, hurrah... now I just need to work out how to make it not work if the ID doesn't exist :)
 
Back
Top Bottom