tags:

views:

55

answers:

2

i have a site

site.com/?w=thisworks
site.com/w/thisalsoworksmanually

i got this to work via htaccess

now i have a form... when it gets submitted

i get site.com/?w=stuffsubmitted i'm trying to have it auto redirect to site.com/w/stuffsubmitted

here is my htaccess that works

RewriteEngine on

RewriteRule ^w/([^/]+)/?$ /index.php?w=$1 [L]

basically..i want to auto redirect to a clean url when form gets submitted.. if you need some more clarification..please ask.

A: 

Simple solution. Don't submit form with method="GET". If you have to submit POST form, you will write manually action url.

hsz
i have to use get
andrewk
A: 

You redirect from the worng way, you redirect site.com/w/stuffsubmitted to site.com/?w=stuffsubmitted and you say that you want to redirect url with query string to that which don't have one.

RewriteCond %{query_string} w=(.*)
RewriteRule ^$ /w/%1? [R=301]
jcubic
for some reason this is not cutting it.. any ideas
andrewk
I change `RewriteRule`
jcubic