I’m probably breaking all the rules of eticate again, but this isn’t really CI related, so I popped it in the lounge. I need someone to ‘teach me how to fish’ ![]()
I’m ( for the first time ) trying to get to grips with mod_rewrite. I’m hoping someone can offer some examples to get me going, and I can tweak them, but right now I’m at a brick wall. I think I’m ok with things like adding the www on the front and stuff, its just the more detailed rules I’m struggling with.
Heres what I want to do:
From the root, any number of letters or numbers followed by a slash and nothing else:
http://www.mysite.com/about/
Remove the slash and replace with a .php:
http://www.mysite.com/about.php
*Except don’t rewrite a specified one, leave as is:
http://www.mysite.com/contact/
A similar thing for the products folder:
http://www.mysite.com/products/satellite/
to
http://www.mysite.com/products/satellite.php
and finally:
http://www.mysite.com/products/satellite/rent/
to remove the end slash and swap with a .php, and replace /rent with -rent
http://www.mysite.com/products/satellite-rent.php
I’m not asking for someone to just do this for me (ok so maybe I am), but I think if I’ve got a couple of examples, I’ll be able to see how its done. I’ve got a load more rules to add for things like url parameters, but I want to have a bash at those, hopefully with the knowledge I’m gained from these ones…
