views:

203

answers:

2

I have an installation of YOURLS that redirects generated addresses to a different domain, however the root does not redirect. How can I set a rule that cooperates with the existing rules to achieve this? Here's the .htaccess file as it stands:

# BEGIN ShortURL
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z]+)/?$ yourls-go.php?id=$1 [L]
# END ShortURL

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</IfModule>

I have a basic understanding of these methods, however I do not know how separate rules affect one another. Thanks in advance for your help.

A: 

It will probably suffice if you replace the + quantifier (one or more repetitions) of your first rule with the * quantifier (zero or more repetitions).

Gumbo
Thanks for the suggestion. Unfortunately, that did not work.
Adam
A: 
Paul
This solution retains the URL shortening functionality, however attempting to access the root triggers a redirect loop.
Adam