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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -