Problème de redirection permanente pour mon site web

HibouJovial Messages postés 1 Date d'inscription samedi 7 septembre 2024 Statut Membre Dernière intervention 9 septembre 2024 - Modifié le 8 sept. 2024 à 11:30
thev Messages postés 1871 Date d'inscription lundi 7 avril 2008 Statut Membre Dernière intervention 14 septembre 2024 - 8 sept. 2024 à 10:36

Bonjour,

Je dois créer un site en Joomla V5.

Mon hébergeur Mailo me demande d'ajouter une redirection permanente dans le .htaccess deux options s'offrent à mois mais je ne suis pas un pro de la programmation. https://faq.mailo.com/sites/redirection-301.htm 

Pourriez vous me dire si la syntaxe est correcte ? 

Choix 1 :

" RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\monsite.com
RewriteRule ^(.*)$ https://www.monsite.com%{HTTP_HOST}/$1  [R=301,L] "

Choix 2: " RedirectPermanent monsite.com/ https://www.monsite.com/"

Merci,

A voir également:

1 réponse

thev Messages postés 1871 Date d'inscription lundi 7 avril 2008 Statut Membre Dernière intervention 14 septembre 2024 687
8 sept. 2024 à 10:36

Bonjour,

D'après le .htaccess fourni par Joomla V5, je prendrai le choix1

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

Par ailleurs, possédant un site Joomla V5 , je n'ai pas besoin de cette instruction chez mon hébergeur, cette redirection étant effectuée automatiquement. Donc vérifiez que c'est bien nécessaire. 


1