Expand my Community achievements bar.

AEM 6.3: Bad Request when replacing dot in selector for slash

Avatar

Level 4

I am trying to make my product details page have the following format: 

https://stage.aemsite.com/en/product-details/some-product

 

We use selectors for our product details so I understand AEM won't be able to interprete this, my idea was to use the dispatcher to allow a passthrough to the correct format https://stage.aemsite.com/en/product-details.some-product, but this is resulting in a bad request. I tested this on https://technicalseo.com/tools/htaccess/ and it should technically work.

 

 

RewriteCond %{REQUEST_URI} ^/([a-z]{2})/product-details/([^?]*)(/?)$
RewriteRule ^ https://%{SERVER_NAME}/%1/product-details.%2 [PT,L,NC]

 

Any idea?

4 Replies

Avatar

Community Advisor

Check your webserver settings the urls may be blocked. If the client is sending a request to an invalid URL — particularly one that is malformed via improper characters — this could result in a 400 Bad Request Error.

Is request reaching to AEM or Dispatcher or it is blocked by Apache server itself?



Arun Patidar

Avatar

Level 4
After checking the logs I found this error: [core:error] [pid 20651:tid 139675540870912] [client 10.73.0.60:44460] AH00126: Invalid URI in request GET /en/product-details/product-name HTTP/1.1 I think what's happening is that I need the actual page path meaning /content/mysite/en.shop-details bla bla