Dynamic links convert to seo links

How can I convert all php links to ceo links. For example with pages.php?c=8 to pages/c/8

Do I need to in .htaccess file to add every scenario for my url’s like ?c=x&d=x&y=x or is it possible as I can assume to convert all php files with ?somevar to seo.
If anyone is willing to help with concrete example of .htaccess file.

thanks in advance

Generally people do one of two things.

A. Using htaccess, set up a RewriteRule for each individual script.
For example, you would set up a rule for pages/8 to pages.php?c=8, a rule for news/2010/03 to news.php?year=2010&month=03, etc.

B. Using two RewriteCond’s and a RewriteRule, set it up so that any non-existing files and folders are passed to a single script (known as a front-controller). The front-controller (a php script) parses the URI and determines which script needs to be loaded.

jovalex,

I’m afraid that you’ve got it backward: YOU, Mr Webmaster, are responsible for creating the links in the format you require (e.g., pages/c/8) THEN you write mod_rewrite statements to convert them (as suggested by simshawn) to your pages.php script with the query string you need.

I’ve outlined this process in my signature’s mod_rewrite tutorial. Have a read then, if necessary, come back with questions.

Regards,

DK

thanks for replies, I’ll take a look this mod_rewrite tutorial.