Forum Moderators: phranque

Message Too Old, No Replies

Remove post variable from url

         

DPCurrier

5:35 pm on Jan 30, 2009 (gmt 0)

10+ Year Member



I have a form that appends ?results=new to the end of the url.

I cannot seem to get a rewrite rule to remove this.

The page posts to itself.

I would like to rewrite example.com/?results=new

to display as: example.com/

Thank you in advance for your assistance.

jdMorgan

8:00 pm on Jan 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you wish to change the display URL, then you must change the URL output by the script that produces the HTML page. Mod_rewrite cannot 'fix' this problem for you, as the 'real' URL is determined (indeed, it is *defined*) by the link appearing on your page.

Once the URL is corrected, mod_rewrite can do two things for you: It can redirect a request for the old URL to the new one to force search engines to update their listings of your URLs, and it can internally rewrite a request for the new URL to the correct script filepath, adding the query string back on if the script requires it. However, mod_rewrite cannot "change the URL."

This subject is discussed in-depth in several of the tutorials in out Apache forum library (see link at top of this page), and in many, many previous threads here.

Jim