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!!! Quote 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? ??? Quote 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? Quote 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 Quote 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/ Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.