Skip to content

Instantly share code, notes, and snippets.

@LPerderiset
Created August 6, 2026 16:43
Show Gist options
  • Select an option

  • Save LPerderiset/01eca796f059ba189e222f49b120fdd7 to your computer and use it in GitHub Desktop.

Select an option

Save LPerderiset/01eca796f059ba189e222f49b120fdd7 to your computer and use it in GitHub Desktop.
Rediriger son ancien nom de domaine vers le nouveau
RewriteEngine On
# Ne pas rediriger les challenges Let's Encrypt ni le robots.txt
RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/ [OR]
RewriteCond %{REQUEST_URI} ^/robots\.txt$
RewriteRule ^ - [L]
# Rediriger tout le domaine vers le nouveau
RewriteCond %{HTTP_HOST} ^(www\.)?ancien-domaine\.fr$ [NC]
RewriteRule ^ https://www.nouveau-domaine.fr/ [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment