Hi everyone,
I'm sorry to bother you all, but I have been trying do some htaccess rewrites for days now and I am tearing my hair out! I've had assistance from others elsewhere but I can't seem make much progress. I've been studying various help websites, forums, apache documentation but for some reason I just can't get it! PHP no problem - htaccess big problem!
Here is my situation. I have all my 'index' files in the root. Then I have directories (which are called the same as there corresponding root files) which have the supporting files. For example:
In root: blue-widgets.php, red-widgets.php, green-widgets.php
Directories: blue-widgets/, red-widgets/, green-widgets/
Inside blue-widgets/ they might be widget1.php, widget2.php etc
What am I trying to do? Well for a start I would like to remove the .php extension so you can do www.example.com/blue-widget This would bring up the blue-widget file in the root. (the files themselves still have .php extensions).
I would like people who type www.example.com/blue-widgets/ to be redirected to www.example.com/blue-widgets If there is a request for www.example.com/blue-widgets/widget1.php (or something) then simply redirect to www.example.com/blue-widgets/widget1 as the above paragraph.
Hopefully this makes sense, and probably seems really easy to you people! I've been playing around with RewriteConds, Rewrite Rules regular expressions etc but been going round in circles!
Any help is much appreciated!