For tricky setups that require your short url to reside in a different location than your yourls installation
- I want to use http://shorturl.com as my short url but I want to install it at http://shorturl.com/yourls/
- I want to use http://sho.rt as my short url but I want to install it at http://longurl.sho.rt
####Requirements yourls 1.5 or 1.5.1
####Installation
- place the /modify-short-url directory in yourls user/plugins directory
- set YOURLS_SITE to the location of your yourls installation in config.php
- define the short url you wish to share with the public at the end of your config.php after "Personal settings..." Example:
define( 'YOURLS_SHORT_URL', 'http://shorturl.com' );
- Modify the .htaccess file at the location defined by YOURLS_SHORT_URL (see below)
You need to direct traffic from your defined short url to your yourls installation. To do this, create (or modify) an .htaccess file in the directory you defined as your YOURLS_SHORT_URL with the following:
RewriteEngine On
RewriteBase /
\# BEGIN YOURLS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z]+)/?$ http://shorturl.com/yourls/yourls-go.php?id=$1 [L]
RewriteRule ^([0-9A-Za-z]+)\+/?$ http://shorturl.com/yourls/yourls-infos.php?id=$1 [L]
RewriteRule ^([0-9A-Za-z]+)\+all/?$ http://shorturl.com/yourls/yourls-infos.php?id=$1&all=1 [L]
\# END YOURLS
.htaccess is tricky and everyon's setup will be slightly different so that part is on you. Otherwise, feel free to submit problems feature requests using the GitHub issue tracker
developed by @greg_gerber