views:

23

answers:

1

Hello,

I'm working on a custom CMS that another developer built a few years ago. I need to change the urls to clean segment based urls from query strings. I could just add the rules for all the pages in the .htaccess file, which would be a pain as that's a lot of pages. Plus when a new page is added, obviously I won't be there waiting to quickly add a rewrite rule.

How do I set this up so it automatically adds it's own rewrite rules. Like the modules and plugins in Drupal and Wordpress do?

Thanks!

A: 

Ok so following on from my comment:

Get the rewrite rules for your urls either by hand (if you're mad) or using this great tool:

http://www.generateit.net/mod-rewrite/ and add them to .htaccess in your root folder.

Then go through and change the links in your code swapping out the query string parts, ?q= etc, for whichever delimiter you chose, - or /. Et voila, it should now work.

Hope this helps someone else...

Robimp