danbd/redirect

There is no license information available for the latest version (V1.1) of this package.

V1.1 2018-05-03 19:31 UTC

This package is not auto-updated.

Last update: 2025-07-07 03:05:22 UTC


README

URL redirector using Redis key-value database and Apache Server with htaccess

Any URL redirected by the htaccess file to the will be checked by redis if there is a corresponding value, if any, will redirect the visitor to the URL specified in the database.

Configuring

Redis

If it is not installed, first you need to install the Redis database. You can find instructions on how to do it on the official website/.

In Debian/Ubuntu run the command:

sudo apt install redis-server

Htaccess

The .htaccess file must be enabled in the Apache settings/

The file should look like this:

RewriteEngine on

RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-l

RewriteRule ^(.*)$ index.php?url=$1 [NC]

If the project is not in the root folder of the domain, you need to add the path to the file:

RewriteRule ^(.*)$ project/index.php?url=$1 [NC]