le007 Posted September 14, 2007 Share Posted September 14, 2007 Hey all, say my site after going through a search comes up with this address: http://www.mysite.com/index.php?locate=results&city=DY&minp0&max=9&othercritera=%&moregoeshere how could I get it sent through .htaccess like with this: if I put this in .htaccess instead of http://www.mysite.com/index.php?locate=email RewriteEngine On RewriteRule ^email$ index.php?locate=email the person would only need to type: http://www.mysite.com/email Somebody please tell me how to do the same for this: http://www.mysite.com/index.php?locate=results&city=NYC&minp0&max=9&othercritera=%&moregoeshere so they'd only have to type in: http://www.mysite.com/nyc How can the PHP do this on the fly? I really dunno how to do it... fetch it from the db and write it etc - complete novice... I have a mysql db set up with the data in it already. Thanks!!! Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/ Share on other sites More sharing options...
le007 Posted September 15, 2007 Author Share Posted September 15, 2007 Anyone? ??? Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/#findComment-348788 Share on other sites More sharing options...
le007 Posted September 15, 2007 Author Share Posted September 15, 2007 Someone must know? Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/#findComment-349027 Share on other sites More sharing options...
darkfreaks Posted September 15, 2007 Share Posted September 15, 2007 read up http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/#findComment-349029 Share on other sites More sharing options...
rarebit Posted September 15, 2007 Share Posted September 15, 2007 http://forum.modrewrite.com/ Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/#findComment-349058 Share on other sites More sharing options...
le007 Posted September 15, 2007 Author Share Posted September 15, 2007 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)(/([^/]+))?$ index.php?locate=results&city=$1&state=$3&minp0&max=9&othercritera=%&moregoeshere I tried the above and when I typed in mywebsite.com/state it worked but when I typed in mywebsite.com/state/city it didnt ALSO how can I have to parsed through the php so mywebsite.com/state/city appears in the address rather than index.php?locate=results&city=$1&state=$3&minp0&max=9&othercritera=%&moregoeshere Thank you Edit/Delete Message Link to comment https://forums.phpfreaks.com/topic/69411-fetch-address-write-it-to-htaccess-for-novice/#findComment-349158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.