I wonder if you can help me with a problem I am having, and give some advice on best practices.
I have a mysql table as follows
teams
columns: id, name, description
data : 1, Aston Villa, text here
I need to do dynamic rewrites to pull out data from the table. The only way I could think to do this was to use _GET as a variable and and look up the name, and change the case to lower case and swap spaces for -. I know there are a few security issues around doing it this way, but its a nice looking url http://www.mydomain.com/clubs/aston-villa
I have been looking at some frameworks such as yii and they seem to do it php side as apose to in the htaccess file.
Could anyone give me some pointers on the best way to achieve this, I havent managed to find any decent info on the web about best ways to achieve this.
Thanks in advance
Richard
The best solution is to redirect all request to a single file (this is called bootstrapping). The redirect is done in .htaccess like so
Then, in index.php parse the request url, for example, via the
$_SERVERvalues.Even better, just google PHP bootstrap and get one of the very simple functioning samples/demos