Options -Indexes RewriteEngine On RewriteBase / # # Short URLs. # #RewriteCond %{HTTPS} !=on #RewriteRule ^(o|r|j|a|ad|e)/(.*)?$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # RewriteRule ^(o|r|j|a|ad|e)/(.*)?$ url_shortener_test/shortener.php?code=$2&type=$1&request=REDIRECT [NC,QSA,L] RewriteRule ^(s)/(.*)?$ url_shortener_test/shortener.php?code=$2&type=$1&request=REDIRECT [NC,QSA,L] RewriteRule ^(m)/(.*)?$ url_shortener/shortener.php?code=$2&type=$1&request=REDIRECT [NC,QSA,L]