game_over Posted December 13, 2010 Share Posted December 13, 2010 What is the best way to use pretty urls? mod_rewrite or PHP? I want to turn stuff like /portfolio.php?web=sitename into /portfolio/web/sitename Link to comment Share on other sites More sharing options...
0 Another Canuck Posted December 13, 2010 Share Posted December 13, 2010 They're known as FURLs or "Friendly URLs" Personally I used mod_rewrite for a site... but that was ages ago. Can't really say I remember my configuration anymore. All I remember is that it wasn't easy to work with. Link to comment Share on other sites More sharing options...
0 Cupcakes Posted December 13, 2010 Share Posted December 13, 2010 They're known as FURLs or "Friendly URLs" Err, they're known as pretty URLs as well. Uplift, best thing to use is mod_rewrite. If you've got .htaccess, you can use the following to rewrite /portfolio.php?web=sitename. RewriteEngine on RewriteRule ^portfolio/([^/\.]+)/?$ ./portfolio.php?web=$1 [L] That would rewrite it to just /portfolio/sitename. Unless you want/need the extra /web/? Link to comment Share on other sites More sharing options...
0 Another Canuck Posted December 13, 2010 Share Posted December 13, 2010 Err, they're known as pretty URLs as well. Learn something new everyday! I've honestly never seen them called that lol Link to comment Share on other sites More sharing options...
0 game_over Posted December 13, 2010 Author Share Posted December 13, 2010 Err, they're known as pretty URLs as well. Uplift, best thing to use is mod_rewrite. If you've got .htaccess, you can use the following to rewrite /portfolio.php?web=sitename. RewriteEngine on RewriteRule ^portfolio/([^/\.]+)/?$ ./portfolio.php?web=$1 [L] That would rewrite it to just /portfolio/sitename. Unless you want/need the extra /web/? I would prefer the web part it will help categorise and sort Thanks. Link to comment Share on other sites More sharing options...
0 ahmz Posted December 13, 2010 Share Posted December 13, 2010 This'll help you get started: http://www.generateit.net/mod-rewrite/ Link to comment Share on other sites More sharing options...
0 Cupcakes Posted December 13, 2010 Share Posted December 13, 2010 I would prefer the web part it will help categorise and sort Thanks. Then just add /web/ after /portfolio/ in the rewrite. :) Link to comment Share on other sites More sharing options...
0 game_over Posted December 13, 2010 Author Share Posted December 13, 2010 great thank you Link to comment Share on other sites More sharing options...
0 game_over Posted December 16, 2010 Author Share Posted December 16, 2010 i cant get my head around it. is there a regular expression for something like home.php => /home contact.php => /contact about.php => /about or even individually RewriteEngine on RewriteRule ^contact/([^/\.]+)/?$ ./contact.php [L] Link to comment Share on other sites More sharing options...
0 game_over Posted December 17, 2010 Author Share Posted December 17, 2010 still can't do it lol - anyone? this is ultimately what i'm after: first up i just want basic pages changing eg: about.php => /about contact.php => /contact services.php => /services then i'll want something a little more complex eg: portfolio.php => /portfolio portfolio.php?cat=web => /portfolio/web portfolio.php?web=sitename => /portfolio/web/sitename Link to comment Share on other sites More sharing options...
Question
game_over
What is the best way to use pretty urls? mod_rewrite or PHP?
I want to turn stuff like /portfolio.php?web=sitename into /portfolio/web/sitename
Link to comment
Share on other sites
9 answers to this question
Recommended Posts