# ============================================================
#  Consumer Debt Help Association - cdhassoc.org
#  Apache config + 301 redirects from the old WordPress site
# ============================================================

# --- Make index.html the homepage ---------------------------
# (Prevents any leftover WordPress index.php from taking over)
DirectoryIndex index.html index.php

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Force HTTPS
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule ^(.*)$ https://cdhassoc.org/$1 [R=301,L]

  # Force non-www (the old site canonicalized to non-www via WordPress.
  # WordPress is being removed, so we must keep this redirect ourselves.)
  RewriteCond %{HTTP_HOST} ^www\.cdhassoc\.org [NC]
  RewriteRule ^(.*)$ https://cdhassoc.org/$1 [R=301,L]
</IfModule>

# ============================================================
#  301 REDIRECTS - old page URLs -> new pages
# ============================================================

RedirectMatch 301 ^/about/?$                    https://cdhassoc.org/about.html
RedirectMatch 301 ^/blog/?$                     https://cdhassoc.org/blog.html
RedirectMatch 301 ^/quote-form/?$               https://cdhassoc.org/get-started.html
RedirectMatch 301 ^/apply/?$                    https://cdhassoc.org/get-started.html
RedirectMatch 301 ^/contact-us/?$               https://cdhassoc.org/#consult
RedirectMatch 301 ^/faq/?$                      https://cdhassoc.org/#faq
RedirectMatch 301 ^/client-reviews/?$           https://cdhassoc.org/#reviews
RedirectMatch 301 ^/terms-of-service/?$         https://cdhassoc.org/#terms
RedirectMatch 301 ^/privacy-policy/?$           https://cdhassoc.org/#privacy
RedirectMatch 301 ^/debt-settlement/?$          https://cdhassoc.org/article-how-debt-settlement-works.html
RedirectMatch 301 ^/credit-card-debt-relief/?$  https://cdhassoc.org/#debts
RedirectMatch 301 ^/loan-debt-help/?$           https://cdhassoc.org/#debts
RedirectMatch 301 ^/debt-information/?$         https://cdhassoc.org/blog.html
RedirectMatch 301 ^/acdr-disclosure/?$          https://cdhassoc.org/
RedirectMatch 301 ^/sample-page/?$              https://cdhassoc.org/
RedirectMatch 301 ^/home-11/?$                  https://cdhassoc.org/

# ============================================================
#  301 REDIRECTS - old blog posts -> closest new article
# ============================================================

RedirectMatch 301 ^/how-to-get-credit-card-debt-relief-in-2026/?$                                                    https://cdhassoc.org/article-pay-off-credit-card-debt-faster.html
RedirectMatch 301 ^/need-help-managing-your-finances-start-with-credit-card-debt-relief-services/?$                  https://cdhassoc.org/article-pay-off-credit-card-debt-faster.html
RedirectMatch 301 ^/top-strategies-by-credit-card-debt-relief-lawyers-to-regain-financial-control/?$                 https://cdhassoc.org/article-pay-off-credit-card-debt-faster.html
RedirectMatch 301 ^/4-signs-your-company-needs-business-debt-settlement-right-now/?$                                 https://cdhassoc.org/article-signs-you-could-benefit-from-debt-relief.html
RedirectMatch 301 ^/7-legal-debt-techniques-to-reduce-bad-debts/?$                                                   https://cdhassoc.org/article-how-debt-settlement-works.html
RedirectMatch 301 ^/how-do-credit-card-debt-negotiation-services-help-in-debt-negotiation-and-save-your-credit-score/?$ https://cdhassoc.org/article-how-debt-settlement-works.html
RedirectMatch 301 ^/best-debt-settlement-negotiators-vs-diy-debt-negotiation/?$                                      https://cdhassoc.org/article-how-debt-settlement-works.html
RedirectMatch 301 ^/top-debt-settlement-services-with-expert-negotiators/?$                                          https://cdhassoc.org/article-how-debt-settlement-works.html
RedirectMatch 301 ^/credit-card-debt-relief-services-which-option-actually-works-in-2026/?$                          https://cdhassoc.org/article-debt-settlement-vs-bankruptcy.html
RedirectMatch 301 ^/should-you-hire-an-attorney-for-debt-settlement-everything-you-need-to-know/?$                   https://cdhassoc.org/article-debt-settlement-vs-bankruptcy.html
RedirectMatch 301 ^/the-best-credit-card-debt-relief-company/?$                                                      https://cdhassoc.org/#difference

# ============================================================
#  WordPress leftovers (categories, tags, authors, feeds)
# ============================================================

RedirectMatch 301 ^/category/.*$   https://cdhassoc.org/blog.html
RedirectMatch 301 ^/tag/.*$        https://cdhassoc.org/blog.html
RedirectMatch 301 ^/author/.*$     https://cdhassoc.org/
RedirectMatch 301 ^/feed/?$        https://cdhassoc.org/blog.html
