Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Rewrite URL |
|
Author |
|
gijs
Joined: 27 Apr 2012 Posts: 189 Location: The Netherlands
|
Posted: Mon 24 Nov '14 23:59 Post subject: Rewrite URL |
|
|
I'm looking for a way to add a string to the end of an url if it contains a certain string (while using a .htaccess file).
If the url contains: derp.php it will add the following to the end of the url: &code=TEST
E.g. if an url contains derp.php?blabla it will be changed to: derp.php?blabla&code=TEST
How can I accomplish this? |
|
Back to top |
|
gijs
Joined: 27 Apr 2012 Posts: 189 Location: The Netherlands
|
Posted: Wed 26 Nov '14 20:48 Post subject: |
|
|
Code: | RewriteCond %{QUERY_STRING} ^(.*)derp.php(.*)$
RewriteRule %1?blabla&code=TEST%2 |
Would the above code in my .htaccess file do the trick? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|