]> _ Git - ccv-wordpress.git/commitdiff
SEO redirections, custom 404 page and improved search results formatting. WIP #3923...
authorStephen Cameron <stephen@cubedesigners.com>
Thu, 1 Oct 2020 16:47:05 +0000 (18:47 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Thu, 1 Oct 2020 16:47:05 +0000 (18:47 +0200)
.htaccess
wp-content/themes/CCV/resources/views/404.blade.php
wp-content/themes/CCV/resources/views/partials/content-search.blade.php
wp-content/themes/CCV/resources/views/search.blade.php

index 47084c6c2b72ed572d560e27b7b37543e05f5cd0..f0f87bb6edf84249903c8c09b0dc8c576a0b250a 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -17,3 +17,40 @@ RewriteRule . /index.php [L]
 
 # Disable directory index access
 Options -Indexes
+
+
+<IfModule mod_rewrite.c>
+
+       RewriteEngine On
+
+       # Old website URL redirections
+
+       # EN version (temporarily redirecting everything to FR home page since the new EN site isn't ready)
+       RedirectMatch 302 (?i)^/en/(.*) /
+
+       # FR website
+       RedirectMatch 301 (?i)^/equipe-medicale-centre-de-chirurgie-vertebrale-montpellier.php /la-clinique/lequipe/
+       RedirectMatch 301 (?i)^/clinique-du-parc-centre-de-chirugie-vertebrale-montpellier.php /la-clinique/
+       RedirectMatch 301 (?i)^/anatomie-centre-de-chirurgie-vertebrale-montpellier.php /
+       RedirectMatch 301 (?i)^/hernie-discale-centre-de-chirurgie-vertebrale-montpellier /pathologies/hernie-discale-2/
+       RedirectMatch 301 (?i)^/lombalgie-centre-de-chirurgie-vertebrale-montpellier /pathologies/discopathie-lombaire/
+       RedirectMatch 301 (?i)^/canal-lombaire-etroit-centre-de-chirurgie-vertebrale-montpellier /pathologies/canal-lombaire-etroit/
+       RedirectMatch 301 (?i)^/canal-cervical-etroit-centre-de-chirurgie-vertebrale-montpellier /
+       RedirectMatch 301 (?i)^/hernie-discale-cervicale-centre-de-chirurgie-vertebrale-montpellier /pathologies/hernie-discale-cervicale/
+       RedirectMatch 301 (?i)^/scoliose-de-adolescent-centre-de-chirurgie-vertebrale-montpellier /scoliose-de-ladolescence/
+       RedirectMatch 301 (?i)^/scoliose-du-vieillissement-centre-de-chirurgie-vertebrale-montpellier /scoliose-du-vieillissement/
+       RedirectMatch 301 (?i)^/spondylolisthesis-centre-de-chirurgie-vertebrale-montpellier /pathologies/spondylolisthesis/
+       RedirectMatch 301 (?i)^/fracture-et-entorse-colonne-vertebrale-centre-de-chirurgie-vertebrale-montpellier /tassement-vertebral/
+       RedirectMatch 301 (?i)^/prothese-de-disque-montpellier-centre-de-chirurgie-vertebrale.php /competences/la-prothese-discale/
+       RedirectMatch 301 (?i)^/radiologie-interventionnelle-montpellier-centre-de-chirurgie-vertebrale.php /
+       RedirectMatch 301 (?i)^/institut-montpellierain-du-rachis.php /la-clinique/linstitut/
+       RedirectMatch 301 (?i)^/recherche-et-publication.php /la-clinique/linstitut/
+       RedirectMatch 301 (?i)^/programme-de-formation.php /formation/
+       RedirectMatch 301 (?i)^/espace-chirurgien.php /la-clinique/linstitut/
+       RedirectMatch 301 (?i)^/formulaires-patient.php /e-diagnostic/
+       RedirectMatch 301 (?i)^/formulaire-preop.php /e-diagnostic/
+       RedirectMatch 301 (?i)^/formulaire-postop.php /
+       RedirectMatch 301 (?i)^/actualites.html /actualites/
+       RedirectMatch 301 (?i)^/contactez-nous.php /contact/
+
+</IfModule>
index 58e68b2189a8781dccce199a5c4d4741da117799..702864d48a62a656da7369479c00fbca23047a2c 100644 (file)
@@ -1,13 +1,20 @@
 @extends('layouts.app')
 
 @section('content')
-  @include('partials.page-header')
 
-  @if (! have_posts())
-    @alert(['type' => 'warning'])
-      {{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }}
-    @endalert
+  @php
+    // Fetch content from page named 'error-404'
+    // ToDo: make this more robust
+    $page = get_page_by_path('error-404');
+    $pageID = $page->ID;
+
+    if (function_exists('pll_get_post')) {
+      $pageID = pll_get_post($page->ID);
+    }
+
+    if ($pageID) {
+      echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display($pageID);
+    }
+  @endphp
 
-    {!! get_search_form(false) !!}
-  @endif
 @endsection
index 937660fb3437f2cfb651a8bf702cb9fa0fd29784..dc9e384b0f3446712f12a4536f96e016acf742cc 100644 (file)
@@ -1,12 +1,12 @@
 <article @php(post_class())>
   <header>
-    <h2 class="entry-title">
-      <a href="{{ get_permalink() }}">
+    <h2 class="entry-title plain text-lg mb-2">
+      <a href="{{ get_permalink() }}" class="hover:text-pink">
         {!! $title !!}
       </a>
     </h2>
 
-    @includeWhen(get_post_type() === 'post', 'partials/entry-meta')
+    {{--@includeWhen(get_post_type() === 'post', 'partials/entry-meta')--}}
   </header>
 
   <div class="entry-summary">
index 20b1d3e0e2d851afa5075f9bbf43e1e49af7a62c..65477828642208e816ecaa3f5db568852334befc 100644 (file)
@@ -1,19 +1,24 @@
 @extends('layouts.app')
 
 @section('content')
-  @include('partials.page-header')
 
-  @if (! have_posts())
-    @alert(['type' => 'warning'])
-      {{ __('Sorry, no results were found.', 'sage') }}
-    @endalert
+  <div class="my-2v px-4v sm:px-2v spaced-lg">
 
-    {!! get_search_form(false) !!}
-  @endif
+    @include('partials.page-header')
 
-  @while(have_posts()) @php(the_post())
-    @include('partials.content-search')
-  @endwhile
+    @if (! have_posts())
+      @alert(['type' => 'warning'])
+        {{ __('Sorry, no results were found.', 'sage') }}
+      @endalert
 
-  {!! get_the_posts_navigation() !!}
+      {!! get_search_form(false) !!}
+    @endif
+
+    @while(have_posts()) @php(the_post())
+      @include('partials.content-search')
+    @endwhile
+
+    {!! get_the_posts_navigation() !!}
+
+  </div>
 @endsection