Files
kb-anhonesthost/deploy/whmcs-kb-redirects.conf
T

108 lines
7.2 KiB
Plaintext
Raw Normal View History

### BEGIN - KB migration redirects to kb.anhonesthost.com ###
# Added 2026-08-01. The WHMCS knowledgebase is retired; these 301s send its
# URLs to the equivalent page on the dedicated KB.
#
# ORDER MATTERS. Article and category URLs share the shape
# /knowledgebase/<id>/<slug>
# and their IDs COLLIDE (article 5 is "What are my Name Servers?", category 5
# is "WordPress Specific"). The only discriminator is the trailing ".html" on
# articles. Article rules therefore come first and terminate with [L]; the
# category rules below can then match broadly because anything ending .html
# has already been redirected and will never reach them.
#
# The slug is ignored by WHMCS (only the id is read), so it is ignored here
# too — any slug with the right id resolves to the right destination.
#
# The trailing "?" on each target discards the inbound query string.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# --- Articles (.html) -------------------------------------------------
RewriteRule ^knowledgebase/2/[^/]*\.html$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteRule ^knowledgebase/3/[^/]*\.html$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteRule ^knowledgebase/4/[^/]*\.html$ https://kb.anhonesthost.com/email/spam-filtering-changes/? [R=301,L]
RewriteRule ^knowledgebase/5/[^/]*\.html$ https://kb.anhonesthost.com/cpanel/nameservers/? [R=301,L]
RewriteRule ^knowledgebase/6/[^/]*\.html$ https://kb.anhonesthost.com/cpanel/fix-a-403-error/? [R=301,L]
RewriteRule ^knowledgebase/7/[^/]*\.html$ https://kb.anhonesthost.com/cpanel/wordpress-email-from-your-domain/? [R=301,L]
RewriteRule ^knowledgebase/8/[^/]*\.html$ https://kb.anhonesthost.com/cpanel/free-ssl-certificate/? [R=301,L]
RewriteRule ^knowledgebase/9/[^/]*\.html$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteRule ^knowledgebase/10/[^/]*\.html$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteRule ^knowledgebase/11/[^/]*\.html$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteRule ^knowledgebase/12/[^/]*\.html$ https://kb.anhonesthost.com/domains/flush-your-dns-cache/? [R=301,L]
RewriteRule ^knowledgebase/13/[^/]*\.html$ https://kb.anhonesthost.com/support/remote-support/? [R=301,L]
RewriteRule ^knowledgebase/14/[^/]*\.html$ https://kb.anhonesthost.com/whp/getting-started/welcome/? [R=301,L]
# --- Categories (no .html) --------------------------------------------
RewriteRule ^knowledgebase/2/[^/]*/?$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteRule ^knowledgebase/3/[^/]*/?$ https://kb.anhonesthost.com/email/spam-filtering-changes/? [R=301,L]
RewriteRule ^knowledgebase/4/[^/]*/?$ https://kb.anhonesthost.com/cpanel/nameservers/? [R=301,L]
RewriteRule ^knowledgebase/5/[^/]*/?$ https://kb.anhonesthost.com/cpanel/wordpress-email-from-your-domain/? [R=301,L]
RewriteRule ^knowledgebase/6/[^/]*/?$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteRule ^knowledgebase/7/[^/]*/?$ https://kb.anhonesthost.com/cpanel/fix-a-403-error/? [R=301,L]
RewriteRule ^knowledgebase/8/[^/]*/?$ https://kb.anhonesthost.com/support/remote-support/? [R=301,L]
RewriteRule ^knowledgebase/9/[^/]*/?$ https://kb.anhonesthost.com/whp/getting-started/welcome/? [R=301,L]
# --- Legacy query-string URLs -----------------------------------------
# Pre-SEO-URL links still in old tickets and emails:
# knowledgebase.php?action=displayarticle&id=<id>
# knowledgebase.php?action=displaycat&catid=<id>
# WHMCS used to 301 these to the friendly URL itself, but our rules above
# now intercept first — so map them explicitly or they all land on the KB
# home page and lose their destination.
#
# "(^|&)id=" cannot match "catid=" (the preceding char is "t", not & or
# start-of-string), so the two sets can't cross-fire.
RewriteCond %{QUERY_STRING} (^|&)id=2(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=3(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=4(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/spam-filtering-changes/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=5(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/nameservers/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=6(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/fix-a-403-error/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=7(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/wordpress-email-from-your-domain/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=8(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/free-ssl-certificate/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=9(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=10(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=11(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=12(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/domains/flush-your-dns-cache/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=13(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/support/remote-support/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)id=14(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/whp/getting-started/welcome/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=2(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/set-up-your-email-client/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=3(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/email/spam-filtering-changes/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=4(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/nameservers/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=5(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/wordpress-email-from-your-domain/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=6(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/domains/transferring-a-domain-to-us/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=7(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/cpanel/fix-a-403-error/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=8(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/support/remote-support/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)catid=9(&|$)
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/whp/getting-started/welcome/? [R=301,L]
# --- Tags, search, index, and anything else under /knowledgebase ------
# Catch-all last: any KB URL not matched above lands on the KB home page
# rather than a WHMCS 404.
RewriteRule ^knowledgebase\.php$ https://kb.anhonesthost.com/? [R=301,L]
RewriteRule ^knowledgebase(/.*)?$ https://kb.anhonesthost.com/? [R=301,L]
</IfModule>
### END - KB migration redirects to kb.anhonesthost.com ###