How to deal with online forms (with method=GET)

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 12
Joined: 30 Jan 2014, 19:17

How to deal with online forms (with method=GET)

14 Feb 2014, 21:21

So I have an online form with METHOD=GET, and a keyword INPUT field.

When user clicks the SUBMIT button, the following URL shows up on the next screen.
www.company.com/search.asp?keyword=some-text-here

How can I make the URL that shows up on the browser look like
www.company.com/search/some-text-here

Do I need a Redirect here? Or a RewriteRule?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: How to deal with online forms (with method=GET)

17 Feb 2014, 10:20

Hello,


Try using the following:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{QUERY_STRING} ^keyboard=([^&]+)$ [NC]
RewriteRule ^search\.asp$ /%1? [NC,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ /search.asp?keyword=$1 [NC,L]


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests