Question

Suppose I have URL with query string parameter like these:

/index.php?test=MYID

Using mod_rewrite, how can I redirect them to SES URL like these?

/index.php?view=MYID
Was it helpful?

Solution

Try:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^test=(.*)$
RewriteRule ^index\.php$ /index.php?view=%1 [L,R=301]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top