Forum Moderators: phranque
<form action="search_temp.php">
</form>
search_temp.php recieves a query string in this fashion
[blah.com...]
now what i would like to do is somehow change that url above to
search/keyword_radio/keyword.html
and then internally change it back to this which i think i have done right....
RewriteRule ^search/([^/]*)/([^/]*).html search.php?keyword_radio=$1&keyword=$2 [L]
so sort of a 2 part redirection, i understand the second part of it above, but i'm having trouble understanding how to get at query string variables, i've read some posts but i'm not sure i understand how you reference them....
I think your best bet is to use php to change your headers to the URL's you would like, then use mod_rewrite to serve the information. Without doing it this way I cannot think of a way to get what you would like without a 301, permanent move redirect. This could prove to be server intensive if your site is busy, and may not ultimately have the best effect on your SE rankings.
Using php for the header information (URL) would allow you to 'silently' or 'internally' serve the information from the php files without a redirect.
This can normally be accomplished by using php code at the top of your page and setting the header information there, before any html is displayed, or any other information is parsed.
This is very close:
RewriteRule ^search/([^/]*)/([^/]*).html search.php?keyword_radio=$1&keyword=$2 [L]
The only real changes are:
RewriteRule ^search/([^/]+)/([^.]+)\.html /search.php?keyword_radio=$1&keyword=$2 [L]
The change to + requires that there be at least one character that is not a / before the /. The change to .(dot) in the second expression makes it forward-looking, like I think you intended. The \. is to make sure the .(dot) is evaluated as a .(dot) and not 'any characer, except a line break'. Finally the / gives the full path to the file. (Unless, you know you don't need it.)
Hope this helps.
Justin