Getting source of the page with double slash(//) at the end of the URL.

Avatar

Avatar

Umesh_Thakur

MVP

Avatar

Umesh_Thakur

MVP

Umesh_Thakur
MVP

26-03-2021

Dear Members,

I am facing one unique kind of issue with "//" at the end of the url.

When I hit https://dev-demo.edev.mysite.com:8080/personalcare/shop/shampoo/ it works perfectly fine but when I hit the sam url with double slash at the end https://dev-demo.edev.mysite.com:8080/personalcare/shop/shampoo// it gives source of webpage.

When I check the same it browser's Network tab it simply try to call "/" as document as in below image

Umesh_Thakur_0-1616751314529.png

then I try to further analyse the dispatcher log I see with correct url it was looking for regular path in cache but with wrong url(with double slash) it try to look some thing strange to me like

/content/mysite/www/us/en_us/personalcare/shop/shampoo.fold.html/.html

 

we already have remove slash rule on the dispatcher and it is working fine in some environment.

 

I am not able to find the root cause of it. if any one can please share some insight on it.

Thanks

Umesh Thakur

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

879

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

879
Arun_Patidar
MVP

28-03-2021

HI Umesh,

The root cause could be reverse mapping, which is adding .html after end /

You should check the reverse mapping rule as well.

Answers (2)

Answers (2)

Avatar

Avatar

Singaiah_Chintalapudi

MVP

Avatar

Singaiah_Chintalapudi

MVP

Singaiah_Chintalapudi
MVP

29-03-2021

You should be redirecting these requests (ending with //) to 404 page at the apache/dispatcher level. Any specific requirement that you want to allow these pages?

Avatar

Avatar

asutosh_j3

Avatar

asutosh_j3

asutosh_j3

26-03-2021

Hi @Umesh_Thakur 

I see the request URL has "fold" as the selector but not sure where it is coming from.

Can you please try with the below rule and see if it resolves the issue.

 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/+$ $1 [R=301,L]

Thanks!