1
Hier ist mein aktueller .htaccess-Dateicode.Verhindern doppelte 301 Weiterleitungen in .htacess?
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Anmerkung: Ich habe diese Frage geprüft - Remove double 301 redirect from my htacess? Aber es gilt hier nicht, da es keine Redirect
in diesem Code ist.
Ja @anubhava, danke. – Gaurav