Sarah Trees
Sarah Trees

Reputation: 904

.htaccess change name of parameter

I know, there a some similar questions, but I cant find the right Rule, that worked...

If the value of the Parameter "go" started by "newsletter/", then, a new parameter "Section" should be generatet with the fix value "Newsletter". The former value of the Parameter "go" will split and transfer to the new parameter "AWF".

How to change this:

index.php?go=newsletter/newsletter70

into:

index.php?Section=Newsletter?AWF=newsletter70

I've tried a lot like These

RewriteCond %{QUERY_STRING} ^go=newsletter/(.*)
RewriteRule ^index.php?go=newsletter/(.*)$ index.php?Sektion=Newsletter?AWF=%1 [L]

I used "[L]", to stop other folowing rules.

Thank you very much!

Upvotes: 1

Views: 113

Answers (1)

anubhava
anubhava

Reputation: 785196

You can use:

RewriteCond %{QUERY_STRING} ^go=([^/]+)/([^&]+) [NC]
RewriteRule ^(index\.php)$ /$1?Section=%1&AWF=%2 [L,NC,R=302]

Upvotes: 1

Related Questions