mojito Posted September 27, 2007 Share Posted September 27, 2007 Rewriting the query string, I need a correct method to go along with, maybe modrewrite is too complicated for what I need. The functionality I desire is that if someone types in http://www.landed.at/Iraq then the page wont try to find that directory it will set it up like http://landed.at/index.php?country=Iraq&Submit=Submit Im looking at mod_alias here http://httpd.apache.org/docs/2.2/mod/mod_alias.html and trying to see if its what I need ? Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/ Share on other sites More sharing options...
mojito Posted September 27, 2007 Author Share Posted September 27, 2007 So far I have come up with RewriteRule ^landed\.at/(.*)$ /landed.at/index.php?country=$1 [L] and im testing with http://localhost/landed.at/iraq in the browser this isnt working on my localhost (using my CMS) but in a test folder (really nothing in there) it seems to work. Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356288 Share on other sites More sharing options...
marcus Posted September 27, 2007 Share Posted September 27, 2007 RewriteEngine On RewriteRule ^Iraq$ index.php?country=Iraq&Submit=Submit Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356290 Share on other sites More sharing options...
mojito Posted September 27, 2007 Author Share Posted September 27, 2007 Thanks the thing is they can type any one of 170 odd countries and other strings in there, depending on the content I decide to host. so that iraq string will be unknown.. Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356295 Share on other sites More sharing options...
marcus Posted September 27, 2007 Share Posted September 27, 2007 RewriteEngine On RewriteRule ^country\.([^-]*)$ index.php?country=$1&Submit=Submit [L] http://landed.at/country.Iraq Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356297 Share on other sites More sharing options...
mojito Posted September 27, 2007 Author Share Posted September 27, 2007 wow a talented 15 year old !!! will check out your site. But this still wont work, Im not explaining myself very well the url could be http://landed.at/Iraq http://landed.at/Skiing http://landed.at/flash I need that turning into ?country=Iraq..country=Skiing..country=flash for eample then I can redirect them to the relevant page. Thanks for your help this rewrite stuff is pretty tricky. Eventually I want to actually depending on this value (so I should keep it generic i.e. not country=) I would like to look it up in the database to see if its a country or town to save people typing in another level ie. http://landed.at/USA/miami but Im not sure many people will use the site like that anyway so the more simple country only version is what im initially after,helps to look further ahead. ps, your sites look good, do you work for money ? and what would be your hourly rate. Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356299 Share on other sites More sharing options...
marcus Posted September 27, 2007 Share Posted September 27, 2007 Thank you You could just do: RewriteEngine On RewriteRule ^([^-]*)$ index.php?country=$1&Submit=Submit [L] ps, your sites look good, do you work for money ? and what would be your hourly rate. I do work for money, and it depends on the job. I've worked $60/hr the most, but I usually won't charge more than $17-$25/hr. Quote Link to comment https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/#findComment-356614 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.