Sorry, this page is only available in one language

Improved .htaccess for ShortURL

The standard .htaccess of shorturl has some limitations.
Whenever a linked file (like a missing image or a .css/.js) is not found it will be processed by short.php and therefore loading the homepage or 404 page completely instead of a standard 404 errorpage.
The same goes for missing favicon.ico files that most browsers will try to get.

This .htaccess has much better tests on what file is requested and will stop these unwanted loading of pages (effectively speeding up your website).

Replace your current .htaccess with this content (don't forget to merge any other modifications you might have in your current .htaccess!):

RewriteEngine On

## Set an errordocument that will be shown if one of the reserved folders are used.
ErrorDocument 404 '<h1>Not found</h1>'

### - Modify this if your WB is installed in a subdirectory. I.e. /wb/
## RewriteBase /wb/
RewriteBase /

## make google_sitemap.php visible as sitemap.xml
RewriteRule ^sitemap.xml$ google_sitemap.php [L]

## uncomment (remove #) the next lines to rewrite host to force https
#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

## uncomment (remove #) the next lines to include www to your domain
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

## If old url's are called directly - redirect to short url version
RewriteCond %{REQUEST_URI} !/pages/intro.php
RewriteCond %{REQUEST_URI} /pages
RewriteRule ^pages/(.*).php$ $1/ [R=301,L]

## Send the request to the short.php for processing
RewriteCond %{REQUEST_URI} !^/(pages|admin|framework|include|languages|media|modules|account|search|temp|templates|var)/.*$
RewriteCond %{REQUEST_URI} !(\.gif|\.jpg|\.png|\.ico)$ [NC]
RewriteCond %{REQUEST_URI} !(\.css|\.js)$ [NC]
RewriteCond %{REQUEST_URI} !(\.pdf|\.json|\.xml)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([\/\sa-zA-Z0-9._-]+)$ short.php?_wb=$1 [QSA,L]

Back to ShortUrl