apache - RewriteRule redirect not including parameters -


what want redirect

http://example.com/sample/

to

http://example.com/this/that/?which=those

this have tried;

rewriterule ^sample.*$ http://example.com/this/that/?which=those [r=301,l] 

but redirects http://example.com/this/that/ , without parameter.

only when write (random) after url, redirects correctly, including parameter.

what doing wrong? appreciated!!

all need rule:

rewriterule ^sample/?$ /this/that/?which=those [r=302,l,nc,qsa] 

make sure clear browser cache , restart browser once before testing this.

important: remember not use r=301 (permanent redirect) while testing mod_rewrite rules. after verify working, change r=302 (temporary redirect) r=301 (permanent redirect)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -