Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/likejazz/mod-url-replace

Apache module for replacing OLD urls to NEW urls.
https://github.com/likejazz/mod-url-replace

Last synced: 7 days ago
JSON representation

Apache module for replacing OLD urls to NEW urls.

Awesome Lists containing this project

README

        

mod_url_replace
================

Replace OLD urls to NEW urls based on mod_substitute.c

```
LoadModule url_replace_module modules/mod_url_replace.so
...

...
# Replace OLD to NEW servers.
SetOutputFilter URL-REPLACE

```

## DEMO

### Source
```
$ cat index.html

https://t1.search.daumcdn.net/argon/0x200_85_hr/IHxzswBdipQ


https://t2.search.daumcdn.net/argon/0x200_85_hr/ClTWD6PQvux


https://t4.search.daumcdn.net/argon/0x200_85_hr/GWIqfBjaDrt


```

### Service
```
$ echo "GET / HTTP/1.0\n" | nc localhost 8080
HTTP/1.1 200 OK
Date: Thu, 16 Jul 2015 11:29:06 GMT
Server: Apache/2.2.29 (Unix)
Last-Modified: Thu, 16 Jul 2015 09:22:27 GMT
ETag: "2057850-cf-51afa9c1f5ac0"
Accept-Ranges: bytes
Connection: close
Content-Type: text/html

https://t1.search.daumcdn.net/argon/0x200_85_hr/IHxzswBdipQ


https://t99.search.daumcdn.net/argon/0x200_85_hr/ClTWD6PQvux


https://t99.search.daumcdn.net/argon/0x200_85_hr/GWIqfBjaDrt


```

It will convert OLD urls to NEW urls automatically. You don't have to do ANYTHING.

# Installation

Edit PATHs in `modules/url-replace/build.sh` before building.

```
$ sh build.sh
```

You can see `mod_url_replace.so` in `modules` directory from build output.