These days every website, big or small uses mod rewrite to get nice looking urls like www.test.com/news/ instead of www.test.com?page=news. If you use
systems like WordPress or Drupal it’s very easy. You can just enable this opion and your ready. But if your are writing you own applications or websites it’s an whole other story. In these cases you need to get dirty with htaccess and stuff, and as you might know, that’s not a fun thing to do. With this class the needed htaccess is automaticly generated by an install script. The rest of the rewriting is done by defining the needed url’s in php.
Define routes in an ini file or in your
Use different url extensions (php, html, trailing slash, no trailing slash)
Retrieve url parameters with variable names
Install script to generate htaccess
How to use
Below you find a small example of how to use this script. In the zip is an extended help file with more information. This is just to show you how easy it is to use this script.
$routes[‘news’] = “news”;
$routes[‘news-item’] = “news/\$item”;
$routes[‘profile’] = “profile”;
$Info = ModRewriter::Route($routes);
Retrieve the first parameter of an url. For example we open this url www.test.com/news/:
This will echo news.
Retrieve a named parameter when for example the url www.test.com/news/45/ is called:
This will echo 45.
3.84 average based on 120 ratings.
- Clean Company - May 23, 2016
- DropLink - May 23, 2016
- Google Maps for Mobile Site PRO - May 19, 2016
- Twitter Wall for Mobile Site PRO - May 19, 2016
- Mobile Site PRO - May 19, 2016
- API Client - May 19, 2016
- Html Helper Class - May 19, 2016
- API Framework - May 19, 2016
- Form Processor - May 18, 2016
- KeyGen Class - May 18, 2016
- Terminal - May 18, 2016
- Console Log - May 18, 2016
- PHP Mobile phone detection - May 18, 2016
- Easy Login - May 18, 2016
- File Explorer Class - May 18, 2016