PHP - Remove the Specific Segment from URL

561 views Asked by At

I have showing the ad banners in .../openx/banner.php

Each Banner I had set the Banner Link.

After clicking the Banners the Page is redirected with the following URL.

.../openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=1__cb=5b97a864fe__oadest=http%3A%2F%2Fwww.google.com

Here is the root URL : openx/

I want to remove the last segment that is oadest=http%3A%2F%2Fwww.google.com when the page is loaded.

Please anyone help me...

Thanks...

1

There are 1 answers

4
Itay On

Assuming this string is always at the end of your url, try putting this in the appropriate place on your .htaccess file:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)oadset=(.*)$
RewriteRule ^/?ck\.php$ /ck.php?%1 [L]