I’m use to working with $_POST and $_GET arrays in PHP scripts. I’m trying to learn Backbone (specifically the Backbone.sync function) and apparently it assumes that you’ll set up your server so that example.com/student/32053 retrieves the student with id 32053.
- How do I set up my scripts to do this?
- Doesn’t example.com/student/32053 load up index.* from the “32053” subdirectory of “student”?
On an Apache server, use the mod_rewrite module. In you
.htaccessfile, just specify a simple rule like:Doing this, when calling
example.com/data/100, apache will internally callexample.com/data.php?id=100.Let me know if you need a similar example for Microsoft IIS.