HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //old_home_backup/disc.org.uk/public_html/.htaccess
# invoke rewrite engine
RewriteEngine On
RewriteBase /

# Redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Redirect 400,401,403,404,500 to main website
ErrorDocument 400 http://disc.org.uk
ErrorDocument 401 http://disc.org.uk
ErrorDocument 403 http://disc.org.uk
ErrorDocument 404 http://disc.org.uk
ErrorDocument 500 http://disc.org.uk

# redirect all extension to html
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.shtml$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.phtml$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.htm$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.php$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.aspx$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.asp$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.jsp$ $1.html [nc]

# Add a trailing slash (/) to a URL, if the URL did not have a trailing slash before
RewriteRule ^([^.]*[^/])$ /$1/ [L,R=301]

# add trailing slash if missing
rewriteRule ^(([a-z0-9\-]+/)*[a-z0-9\-]+)$ $1/ [NC,R=301,L]
RewriteRule ^wp-admin/ - [L]
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.html
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3.html
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4.html
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5.html
RewriteRule ^index.html$ / [L,R=301]
RewriteRule ^contacts.html$ / [L,R=301]
RewriteRule ^dental\-care\/find\-effective\-teeth\-whitening\-treatment\-in\-leatherhead.html$ / [L,R=301]
RewriteRule ^w\-z\/weight\-loss\/how\-to\-use\-a\-t6\-fat\-burner.html$ / [L,R=301]
RewriteRule ^d\-f\/dentistry\/how\-dirty\-is\-your\-mouth.html$ / [L,R=301]
RewriteRule ^page\/1.html$ / [L,R=301]
RewriteRule ^health\/5\-new\-ways\-to\-save\-on\-medical\-bills.html$ / [L,R=301]