Jump to content

Recommended Posts

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 ?

Link to comment
https://forums.phpfreaks.com/topic/70861-modrewrite-or-modalias/
Share on other sites

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.

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.

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.