diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..f57f641 --- /dev/null +++ b/.htaccess @@ -0,0 +1,24 @@ +# Enable rewrite engine +RewriteEngine On + +# --- SERVICES --- +RedirectMatch 301 ^/etobicoke-treatment-service/cardiac-rehabilitation-etobicoke/?$ /etobicoke-treatment-service/cardiac-rehabilitation-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/compression-stockings-etobicoke/?$ /etobicoke-treatment-service/compression-stockings-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/cranio-sacral-therapy-etobicoke/?$ /etobicoke-treatment-service/cranio-sacral-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/cupping-therapy-etobicoke/?$ /etobicoke-treatment-service/cupping-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/fascial-stretch-therapy-etobicoke/?$ /etobicoke-treatment-service/fascial-stretch-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/gait-assessment-etobicoke/?$ /etobicoke-treatment-service/gait-assessment-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/intramuscular-stimulation-ims-etobicoke/?$ /etobicoke-treatment-service/intramuscular-stimulation-ims-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/kids-physiotherapy-etobicoke/?$ /etobicoke-treatment-service/kids-physiotherapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/motor-vehicle-accident-rehabilitation-etobicoke/?$ /etobicoke-treatment-service/motor-vehicle-accident-rehabilitation-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/neuro-fascial-therapy-etobicoke/?$ /etobicoke-treatment-service/neuro-fascial-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/orthotics-etobicoke/?$ /etobicoke-treatment-service/orthotics-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/pre-post-operative-management-etobicoke/?$ /etobicoke-treatment-service/prepost-operative-management-clinic-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/psychotherapy-etobicoke/?$ /etobicoke-treatment-service/psychotherapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/shiatsu-therapy-etobicoke/?$ /etobicoke-treatment-service/shiatsu-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/shockwave-therapy-etobicoke/?$ /etobicoke-treatment-service/shockwave-therapy-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/surgical-rehab-etobicoke/?$ /etobicoke-treatment-service/surgical-rehab-in-etobicoke/ +RedirectMatch 301 ^/etobicoke-treatment-service/deep-tissue-massage-etobicoke/?$ /etobicoke-treatment-service/deep-tissue-massage-in-etobicoke/ + +# --- OTHER PAGES --- +RedirectMatch 301 ^/ourapproach-physiotherapy-etobicoke/?$ /our-approach-physiotherapy-etobicoke/ diff --git a/app/etobicoke-treatment-service/[slug]/page.js b/app/etobicoke-treatment-service/[slug]/page.js index 023c1a2..07dff4f 100644 --- a/app/etobicoke-treatment-service/[slug]/page.js +++ b/app/etobicoke-treatment-service/[slug]/page.js @@ -3,10 +3,35 @@ import Link from "next/link"; import { notFound } from "next/navigation"; import { servicesList } from "@/utils/Services.utils"; +const notFoundSlugs = [ + "cardiac-rehabilitation-etobicoke", + "compression-stockings-etobicoke", + "cranio-sacral-therapy-etobicoke", + "cupping-therapy-etobicoke", + "fascial-stretch-therapy-etobicoke", + "gait-assessment-etobicoke", + "intramuscular-stimulation-ims-etobicoke", + "kids-physiotherapy-etobicoke", + "motor-vehicle-accident-rehabilitation-etobicoke", + "neuro-fascial-therapy-etobicoke", + "orthotics-etobicoke", + "pre-post-operative-management-etobicoke", + "psychotherapy-etobicoke", + "shiatsu-therapy-etobicoke", + "shockwave-therapy-etobicoke", + "surgical-rehab-etobicoke", + "deep-tissue-massage-etobicoke", + +]; + + export async function generateStaticParams() { - return servicesList.map((item) => ({ - slug: item.slug, - })); + const serviceParams = servicesList.map(item => ({ slug: item.slug })); + + const redirectParams = notFoundSlugs.map(slug => ({ slug })); + + // combine both arrays + return [...serviceParams, ...redirectParams]; } export async function generateMetadata({ params }) { @@ -52,12 +77,12 @@ export default function ServiceDetailPage({ params }) {