php - .htaccess - redirect individual urls to url with query string -


i'm looking opposite of common query .htaccess files.

i want redirect standard url url query string, similar below:

test.com/directory/pagename

to:

test.com/template?id=1

i don't require pattern matching of form, want write out separate redirect each one. example:

test.com/colours/red = test.com/template?id=5

test.com/colours/yellow = test.com/template?id=3

hopefully makes sense.

you can use code in document_root/.htaccess file:

rewriteengine on  rewriterule ^colours/yellow/?$ template?id=3 [l,nc,qsa]  rewriterule ^colours/red/?$ template?id=5 [l,nc,qsa] 

Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -