How to rewrite a URL using htaccess?

URL Rewrite Help Get Method?

  • Ok, I have tried to research this on my own so please spare me the simple page links to search results on GET Method or Mod_Rewrite. I need to rewrite a url from a get method search form like this. <form action="" method="get" name="form1" id="form1"> <span class="style7"> <div align="center"> State: <input name="state" size="3" maxlength="2" /> City: <input name="city" size="30" /> <input type=SUBMIT value="Go There!" /> <p></p> </div> </span> </form> Where a user can enter a city name and a state code. Such as Seattle WA and currently it returns it in a query string (obviously) What steps do I need to take to rewrite this to rewrite the url as www.domain.com/state/wa/city/seattle.h… Which is where the page will reside. I have messed around with my .htaccess file countless times trying various codes using all types of things (and from rewrite code generators) and nothing happens. Do I need a php file to process it? Any code would be a huge help!

  • Answer:

    You definitely need a script to process the form. Right now you form won't do anything because the action is "" which means nothing. You need to have the action call a script that processes the form. This can be PHP, Java, ASP or a bunch of other things. The easiest one to do would probably PHP

david r at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.