Hab das Prolem selber gelöst bekommen bzw. mit Hilfe der neuen Chatbot K.i. - Krass kann ich nur allen raten sich das anzusehen.
Also wie der Info Text am Boden sagt muss der ganz nach oben vor allen anderen Einträgen !! Damit gings schonmal.
Wer nur die Startseite umschreiben lassen will kann den Eintrag hier nehmen:
Code: Alles auswählen
# if the request is for example.com/index.html"
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTPS/
# then redirect to "example.com/"
RewriteRule ^index\.html$ https://example.com [R=301,L]
Da meine neue Seite bei Google nicht gelistet wird wegen der Sache mit dem duplicate content, bin ich der Sache mal nachgegangen.
Das Problem mit den multiplen Pfaden. http:// und www. habe ich mal weggelassen als Varianten.
https://example.com/index.html
https://example.com/
https://example.com ( Ziel )
https://example.com/kategorie/index.html
https://example.com/kategorie/
https://example.com/kategorie ( Ziel )
Wie bekommt man das modulübergreifend und elegant stromsparend hin
Es gibt die theoretischen Möglichkeiten:
1. Via Apache direkt ?
2. Via .htaccess ?
3. Via Uri shortener Modul ?
4. Via AMR ?
5. Irgendeine geheime .php Seite ?
Ich habe zu dem Thema das hier gefunden aber das geht irgendwie nicht bei der 4.10.1
Code: Alles auswählen
RewriteCond %{THE_REQUEST} index\.html [NC]
RewriteRule ^(.*)index\.html /$1 [NC,L,R=301]
Meine .htaccess liegt im Root /
Jemand eine gute Idee ?
Danke im Voraus
######## Regel scheint soweit gülig zu sein laut K.i. - Für den der es genau wissen wil
ist dieser htaccess eintrag valid ? RewriteCond %{THE_REQUEST} index\.html [NC]
RewriteRule ^(.*)index\.html /$1 [NC,L,R=301]
Yes, the .htaccess rewrite rule you provided is valid and should work as intended. The rule uses the RewriteCond directive to check if the requested URL ends with index.html, and if so, it uses the RewriteRule directive to redirect the request to the same URL without the index.html part.
Here is a breakdown of the rule and what each part does:
RewriteCond %{THE_REQUEST} index\.html [NC]: This line uses the RewriteCond directive to create a condition that checks if the requested URL ends with index.html. The %{THE_REQUEST} variable contains the original request that was sent by the client, and the index\.html part of the condition checks if the request ends with index.html. The [NC] flag at the end of the line makes the match case-insensitive, so the condition will match both index.html and Index.html, for example.
RewriteRule ^(.*)index\.html /$1 [NC,L,R=301]: This line uses the RewriteRule directive to create a rule that applies the redirect if the condition specified in the RewriteCond directive is met. The ^(.*)index\.html part of the rule matches the URL that was requested, and the /$1 part of the rule specifies the target URL of the redirect. In this case, the target URL is the same as the original URL, but with the index.html part removed. The [NC,L,R=301] flags at the end of the line specify that the match should be case-insensitive (NC), the rule should be applied immediately without evaluating any further rules (L), and the redirect should be a permanent redirect (R=301).
Overall, the .htaccess rule you provided is a valid and well-formed rewrite rule that should work as intended. I hope this helps! Let me know if you have any other questions.