From 07f1eca644308795783075ad4df8236928def168 Mon Sep 17 00:00:00 2001 From: Alexis Hassler Date: Thu, 20 Jun 2019 22:21:51 +0200 Subject: [PATCH] Remove html suffixes --- .htaccess | 29 +++++++++++++++++++++--- _global/Special:AllPages.html | 4 ++-- _global/Special:Categories.html | 2 +- _global/Special:ListRedirects.html | 2 +- _global/Special:ListUsers.html | 2 +- _global/Special:LongPages.html | 2 +- _global/Special:RecentChanges.html | 2 +- _global/Special:ShortPages.html | 2 +- _global/feed.xml | 9 ++++---- _global/tags.html | 2 +- _includes/global.html | 2 +- _includes/logo.html | 2 +- _includes/tags.html | 4 ++-- _layouts/contributions.html | 2 +- _layouts/redirect.html | 2 +- _plugins/contributions-page-generator.rb | 6 ++--- _wiki/Main.md | 12 +++++----- 17 files changed, 55 insertions(+), 31 deletions(-) diff --git a/.htaccess b/.htaccess index 53d89e2..3e77119 100644 --- a/.htaccess +++ b/.htaccess @@ -1,10 +1,33 @@ RewriteEngine On +# ################ +# RSS +# ################ RewriteCond %{QUERY_STRING} ^title=Special:Newpages\&feed=rss$ -RewriteRule ^index\.php$ /feed.xml? [R=301,L] +RewriteRule ^index\.php$ https://%{HTTP_HOST}/feed.xml [R=301,NE,QSD,L] +# ################ +# Conmpanion pages +# ################ RewriteCond %{QUERY_STRING} ^title=Sp%C3%A9cial:Nouvelles_pages&feed=rss$ -RewriteRule ^index\.php$ /feed.xml? [R=301,L] +RewriteRule ^index\.php$ https://%{HTTP_HOST}/feed.xml [R=301,NE,QSD,L] +RewriteCond %{QUERY_STRING} ^title=Special:Export/(.*)$ +RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L] + +RewriteCond %{QUERY_STRING} ^title=Sp%C3%A9cial:Exporter/(.*)$ +RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L] + +RewriteCond %{QUERY_STRING} ^title=Discussion:(.*)$ +RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L] + +# ################ +# Main pages +# ################ RewriteCond %{QUERY_STRING} [^&?]*?=([^&?]*)[&]?(.*) -RewriteRule ^index\.php$ /%1.html?%2 [R=301,L] \ No newline at end of file +RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1?%2 [R=301,NE,L] + +# ################ +# Error pages +# ################ +ErrorDocument 404 https://%{HTTP_HOST}/404 \ No newline at end of file diff --git a/_global/Special:AllPages.html b/_global/Special:AllPages.html index 90080f8..d54fd6b 100644 --- a/_global/Special:AllPages.html +++ b/_global/Special:AllPages.html @@ -11,8 +11,8 @@ menu: ['global'] {%- assign page_name = page_name | append: " - " | append: page.title -%} {%- endif -%}
  • - {{ page_name }}  [{{ page.bytes }} bytes] - {%- if page.author_full -%} (by {{ page.author_full.name }}) {%- endif -%} + {{ page_name }}  [{{ page.bytes }} bytes] + {%- if page.author_full -%} (by {{ page.author_full.name }}) {%- endif -%}
  • {%- endfor -%} diff --git a/_global/Special:Categories.html b/_global/Special:Categories.html index 5db067b..6e7bce9 100644 --- a/_global/Special:Categories.html +++ b/_global/Special:Categories.html @@ -13,6 +13,6 @@ menu: ['global'] {%- endif -%} {%- endfor -%} -
  • {{ tag }} ({{counter}} pages)
  • +
  • {{ tag }} ({{counter}} pages)
  • {%- endfor -%} diff --git a/_global/Special:ListRedirects.html b/_global/Special:ListRedirects.html index 9003bdf..937cd8b 100644 --- a/_global/Special:ListRedirects.html +++ b/_global/Special:ListRedirects.html @@ -7,7 +7,7 @@ menu: ['global'] {%- for source_page in site.data.wiki_redirects -%}
  • {%- assign redirect_page = source_page.redirect_target -%} - {{ source_page.id }}{{ redirect_page.title }} + {{ source_page.id }}{{ redirect_page.title }}
  • {%- endfor -%} diff --git a/_global/Special:ListUsers.html b/_global/Special:ListUsers.html index 1a1b510..bfa35d7 100644 --- a/_global/Special:ListUsers.html +++ b/_global/Special:ListUsers.html @@ -6,7 +6,7 @@ menu: ['global'] diff --git a/_global/Special:LongPages.html b/_global/Special:LongPages.html index e7ba1a5..8deeecb 100644 --- a/_global/Special:LongPages.html +++ b/_global/Special:LongPages.html @@ -7,7 +7,7 @@ menu: ['global']
      {%- for page in long_pages limit:50 -%}
    1. - {{ page.title }}  [{{ page.bytes }} bytes] + {{ page.title }}  [{{ page.bytes }} bytes]
    2. {%- endfor -%}
    diff --git a/_global/Special:RecentChanges.html b/_global/Special:RecentChanges.html index 5620476..d268eac 100644 --- a/_global/Special:RecentChanges.html +++ b/_global/Special:RecentChanges.html @@ -7,7 +7,7 @@ menu: ['global']