Thursday 22 August 2013

.htaccess redirect by adding parameter if required

.htaccess redirect by adding parameter if required

I need to add a parameter to my current URL (but only if the paramter
isn't set yet). The other parameters should be kept (I think I can do so
by adding %{QUERY_STRING}?).
Example:
index.php?page=1
So, let's say I want to always add a parameter for the language- the URL
should look like this:
index.php?page=1&lang=1
But if lang is already set, it should do nothing.

No comments:

Post a Comment