my website is build from php so my url's are something like, /php?id=17. Anyways, i want to make the url like /something-something-cool and i want the /php?id=17 page appear on the mew link. What is the code, or how do you call out php functions to open in different urls? im doing this for better SEO, so i could add custom meta tags for every page. Any suggestions?
Use some URL rewriting tool like the one given below: http://www.webconfs.com/url-rewriting-tool.php I hope this helps.
thanks, really nice tool, but, it only changes the url. I need to change the page a bit so i could stick meta tags to it and rename some pages...
General Idea for this is: using mod_rewrite redirect all *.html URLs to one script say index.php. Inside index.php you analize the page name user requested and decide what id should service the responce. Then you include your /php passing it appropriate id.
header('location: http://www.YourSite.com/something-something-cool.php'); this is just a redirect, if you want a perm redirect use .htacess to make the pages point to the new pages. get the .htaccess code its simple.
I came for the same problem with my website www.dom2000.com.ua. I have created an array of all keywords of articles like and then mapped it to IDs: $map = array( 'my_page' => 1, 'other_page' => 2, 'super_page' => 3, ); $rmap = array_flip($map); $prefix = 'x_'; Code (markup): All they are started with specific prefix. Then the routers (or any initial script) parses the $_SERVER['REQUEST_URI'], checks if it starts with that prefix and if yes, extracts the ID from mapping array. function get_id() { $id = @$_GET['id']; if (strpos($_SERVER['REQUEST_URI'], $prefix)!==false) { $s = substr($_SERVER['REQUEST_URI'], strlen($prefix)); if (isset($map[$s]) {$id = $map[$s]; break; }; } return $id; } Code (markup): When you create links, you search array for ID and get the keywords part of it: function url_by_id($id) { $url = '/?id='.$id; if (isset($rmap[$id])) $url = $prefix.$rmap[$id]; return $url; } Code (markup): Here are a few examples (in Ukrainian), $prefix='kiev_': Купить Ñклад в Киеве Продать Ñклад в Киеве Ðрендовать Ñклад в Киеве Сдать Ñклад в Киеве Купить дом/коттедж в ОбуховÑком районе Купить дом/коттедж в БориÑпольÑком районе Купить дом/коттедж в Киево-СвÑтошинÑком районе Купить дом/коттедж в ВаÑильковÑком районе