mardi 2 avril 2019

Redirect links in S3 static website hosting to new URL without .html ending

I am prettifying my URLs to remove the .html at the end of my links. So far, so good, I don't need help with that. I am trying to provide a redirect, in case someone has an old link with the .html still present. So I want to redirect:

example.com/articles/dmg-me.html
to 
example.com/articles/dmg-me

I have put in the following as a redirection rule in my S3 bucket but it does not work.

<RoutingRules>
  <RoutingRule>
    <Condition>
      <KeyPrefixEquals>.html</KeyPrefixEquals>
    </Condition>
    <Redirect>
      <HostName>gameboyessentials.com</HostName>
      <ReplaceKeyPrefixWith></ReplaceKeyPrefixWith>
    </Redirect>
  </RoutingRule>
</RoutingRules>

I have other redirects in that same XML file who do work.




Aucun commentaire:

Enregistrer un commentaire