views:

16

answers:

1

i have this line

Redirect /?page=cms_page&id=12 http://www.domain.dk/case

when i type ?page=...... its not will work if i only use page=..... its will work fine but not the user type

domain.dk/?page=cms_page&id=12

So now i ask you guys what have i make wrong?

A: 

With the directives of mod_alias you can only test for the URI path but not the URI query. To do so, you can use mod_rewrite:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^page=cms_page&id=12$
RewriteRule ^$ http://www.example.com/case? [L,R]

The empty query in the substitution will avoid that the original query will automatically appended to the new URI. And the R flag will force an external redirect.

Gumbo