Apache mod_rewrite URL redirect script


I wrote a bash script to automate the Apache (mod_rewrite) URL redirection. It supports 3 types of redirection:

– One to One: eg. From http://jackiechen.local/mylab To http://jackiechen.org./mylab

– Any to One: eg. From http://jackiechen.local/* To http://jackiechen.org

– Any to Any: eg. From http://jackiechen.local/$1 to https://jackiechen.org/$1

The script can be downloaded from here

Note: I tested the script in my local, so the script spoof the domain to local in the hosts file. Remove that part if the fqdn can be resolved.

2014-12-07 20_20_49-root@fedora__etc_httpd_conf_rewrites

Advertisements

One thought on “Apache mod_rewrite URL redirect script

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s