Fireye Posted December 19, 2008 Share Posted December 19, 2008 ... into a query? I've seen several sites about that take say, www.stuff.com/view/washingtondc/10582 and interpret that to be a query instead of a physical directory. I envision taking my current custom gallery script and reworking it to use a structure like that, where /view/washingtondc/10582 would equal my ?command=view&album=washingtondc&photo=10582 is currently. Is that a function of apache, or can it be handled by PHP? I really just need a direction to be pointed in, because I'm not quite sure how to phrase my question in a google-friendly manner Link to comment https://forums.phpfreaks.com/topic/137756-solved-how-would-i-go-about-converting-url-params/ Share on other sites More sharing options...
flyhoney Posted December 19, 2008 Share Posted December 19, 2008 That is done by an apache module called mod_rewrite. It is used to setup rewrite rules for urls using regular expressions. Rewrite rules are kept in a .htaccess file at your site's root. A typical .htaccess file looks something like this: # begin mod rewrite RewriteEngine on RewriteBase / # special pages RewriteRule ^view/?([a-zA-Z0-9_\/]+)/?$ view.php?$1 So if I were you, I would look into mod_rewrite and PHP. Link to comment https://forums.phpfreaks.com/topic/137756-solved-how-would-i-go-about-converting-url-params/#findComment-720022 Share on other sites More sharing options...
Fireye Posted December 19, 2008 Author Share Posted December 19, 2008 Excellent, thank you for the info, I'll start reading up on mod_rewrite! Link to comment https://forums.phpfreaks.com/topic/137756-solved-how-would-i-go-about-converting-url-params/#findComment-720025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.