regdude Posted October 15, 2008 Share Posted October 15, 2008 Hi! I have been noticing that many websites have this kind of a URL: http://web.com/user/someone123 Wanted to know what is this thing called? Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/ Share on other sites More sharing options...
wildteen88 Posted October 15, 2008 Share Posted October 15, 2008 This is archived using mod_rewrite Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/#findComment-666282 Share on other sites More sharing options...
regdude Posted October 15, 2008 Author Share Posted October 15, 2008 Isn't this possible with other HTTP servers? like lighttpd? it also has mod_rewrite. And isn't this dangerous to use mod_rewrite? As I remeber there was a remote exploit using this module. Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/#findComment-666285 Share on other sites More sharing options...
trq Posted October 15, 2008 Share Posted October 15, 2008 Yes, Lighttp has a mod_rewrite implimentaion. Being open-source software whatever expliots are found are generally patched within hours. Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/#findComment-666296 Share on other sites More sharing options...
regdude Posted October 15, 2008 Author Share Posted October 15, 2008 Ok, I did a simple thing, products.php: <?php echo $_GET['id']; ?> .htaccess: RewriteRule ^/products/([0-9]+) /products.php?id=$1 When I enter http://localhost/products/1 - it should return value 1, but it doesn't. Btw, is it safe using this way? Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/#findComment-666321 Share on other sites More sharing options...
wildteen88 Posted October 15, 2008 Share Posted October 15, 2008 Btw, is it safe using this way? It as safe as the original url. All you're doing is making your urls cleaner. You still need to sanitize your data as you would normally. As for why its not working remove the caret symbol ^ from your rewrite rule: RewriteRule /products/([0-9]+) /products.php?id=$1 Link to comment https://forums.phpfreaks.com/topic/128569-solved-different-url-style/#findComment-666327 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.