# Rewrite URL's Glype

**URL:** <https://www.ruby-forum.com/t/rewrite-urls-glype/218532>\
**Category:** NGINX\
**Created:** [April 3, 2012, 4:56pm UTC](https://www.ruby-forum.com/t/rewrite-urls-glype/218532 "2012-04-03T16:56:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 3, 2012, 4:56pm UTC](https://www.ruby-forum.com/t/rewrite-urls-glype/218532/1 "2012-04-03T16:56:31Z")

</div>

Hi all,

I’ve a Glype proxy and I want to rewrite the URL’s. All URLs on the page  
are automatically converted to:  
[http://proxy.com/browse.php?u=URL](http://proxy.com/browse.php?u=URL) HERE

Example: If I go to /browse on The Pirate Bay on my proxy I want to  
convert the URL from this:  
[http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Fbrowse&b=0](http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Fbrowse&b=0)

To this:  
[http://proxy.com/tpb/browse](http://proxy.com/tpb/browse)

Also if i go to:  
[http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Ftop&b=0](http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Ftop&b=0)

Then I want to convert to:  
[http://proxy.com/tpb/top](http://proxy.com/tpb/top)

As you can see, the whole part:  
browse.php?u=http%3A%2F%2Fthepiratebay.se%2F

Is gone (and the `&b=0` what is behind the URL). And it has the same  
domain structure as The Pirate Bay.

I’ve tried something like this, in the .htaccess file:  
location /tpb/ {  
rewrite ^/browse.php?u=(.\*)$ /$1? last;  
break;  
}

But it is not working. Somebody has an answer? An other function is also  
welcome. (Such as `fastcgi_split_path_info` or something else what is  
compatible with nginx)

(If you want see a example go to tpb.piratenpartij.nl but I’m not  
sure if they are using Glype)

---

<div class="post-metadata">

**Author:** ![tonhoekstra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/74df32/32.png) [@tonhoekstra](https://www.ruby-forum.com/u/tonhoekstra)\
**Post date:** [May 14, 2012, 5:59pm UTC](https://www.ruby-forum.com/t/rewrite-urls-glype/218532/2 "2012-05-14T17:59:28Z")

</div>

I tried to figure this problem out myself but I couldn’t…

I searched a lot with no results… so, can anybody help us?

Posted at Nginx Forum:

> **[Re: Rewrite URL's Glype](https://forum.nginx.org/read.php?2,224876,226419#msg-226419)**
>
> Hi all, I've a Glype proxy and I want to rewrite the URL's. All URLs on the page are automatically converted to: http://proxy.com/browse.php?u=URL HERE Example: If I go to /browse on The Pirate Bay on my proxy I want to convert the URL from this: htt

---

<div class="post-metadata">

**Author:** ![tonhoekstra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/74df32/32.png) [@tonhoekstra](https://www.ruby-forum.com/u/tonhoekstra)\
**Post date:** [May 14, 2012, 6:00pm UTC](https://www.ruby-forum.com/t/rewrite-urls-glype/218532/3 "2012-05-14T18:00:07Z")

</div>

I tried to figure this problem out myself but I couldn’t…

I searched a lot with no results… so, can anybody help us?

Posted at Nginx Forum:

> **[Re: Rewrite URL's Glype](https://forum.nginx.org/read.php?2,224876,226420#msg-226420)**
>
> Hi all, I've a Glype proxy and I want to rewrite the URL's. All URLs on the page are automatically converted to: http://proxy.com/browse.php?u=URL HERE Example: If I go to /browse on The Pirate Bay on my proxy I want to convert the URL from this: htt

---

<div class="post-metadata">

**Author:** ![tonhoekstra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/74df32/32.png) [@tonhoekstra](https://www.ruby-forum.com/u/tonhoekstra)\
**Post date:** [May 14, 2012, 6:00pm UTC](https://www.ruby-forum.com/t/rewrite-urls-glype/218532/4 "2012-05-14T18:00:45Z")

</div>

I tried to figure this problem out myself but I couldn’t…

I searched a lot with no results… so, can anybody help us?

Posted at Nginx Forum:

> **[Re: Rewrite URL's Glype](https://forum.nginx.org/read.php?2,224876,226421#msg-226421)**
>
> Hi all, I've a Glype proxy and I want to rewrite the URL's. All URLs on the page are automatically converted to: http://proxy.com/browse.php?u=URL HERE Example: If I go to /browse on The Pirate Bay on my proxy I want to convert the URL from this: htt
