1

The following command is working perfectly in .htaccess Magento 2.

RewriteCond %{THE_REQUEST} \ /(.+).html/
RewriteRule ^ /%1.html [L,R=301]

But when we enable Load balancer (AWS ELB) it stops working. Please help in this regard.

Joe
  • 4,877
  • 5
  • 30
  • 51
  • 1
    You will need to define *"stops working."* What does it do, instead of what you expect? What is in the ALB logs? What is in the web server logs? – Michael - sqlbot Jul 06 '18 at 12:15
  • Stops working mean it doesn't redirect. – Shujaat Ali Jul 07 '18 at 12:13
  • Right... and does what, instead? Returns an error? Returns different content? If it isn't redirecting, then it must be doing something different. Also, is this a Classic ELB or an Application Load Balancer (ALB, ELB/2.0)? – Michael - sqlbot Jul 07 '18 at 15:52
  • 1
    It has been resolved by this: RewriteCond %{REQUEST_URI} (.+)\.html/ RewriteRule ^ https://%{HTTP_HOST}%1.html [R=301,L] – Shujaat Ali Jul 09 '18 at 13:23

0 Answers0