コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Best approach to remove appending " /"

Avatar

Level 5

Hi All,

When we tried to hit the URL with appending - '/' like:- http://<>*.mp4/ for the first time, request goes to the CQ and gives the error, but in this process dispatcher is creating folder with *.mp4. and as usual next subsequent requests will give errors as it tries to fetch from the cache.

What would be best approaches:-

1, like adding a rule in dispatcher like:- this worked for me.

/0046 { /type "deny" /glob "GET *.mp4/*" }

2, Adding a rewrite rule on the apache. it also worked but i it is creating issue some times.

RewriteRule ^(/.*\.(png|gif|jpg|mp4))/$ $1

 

Thanks,

viki

1 受け入れられたソリューション

Avatar

正解者
Level 10

Mahesh Vikram wrote...

Hi All,

When we tried to hit the URL with appending - '/' like:- http://<>*.mp4/ for the first time, request goes to the CQ and gives the error, but in this process dispatcher is creating folder with *.mp4. and as usual next subsequent requests will give errors as it tries to fetch from the cache.

What would be best approaches:-

1, like adding a rule in dispatcher like:- this worked for me.

/0046 { /type "deny" /glob "GET *.mp4/*" }

2, Adding a rewrite rule on the apache. it also worked but i it is creating issue some times.

RewriteRule ^(/.*\.(png|gif|jpg|mp4))/$ $1

 

Thanks,

viki

 

Change your second rule like which will work for all file type without any problem

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

元の投稿で解決策を見る

1 返信

Avatar

正解者
Level 10

Mahesh Vikram wrote...

Hi All,

When we tried to hit the URL with appending - '/' like:- http://<>*.mp4/ for the first time, request goes to the CQ and gives the error, but in this process dispatcher is creating folder with *.mp4. and as usual next subsequent requests will give errors as it tries to fetch from the cache.

What would be best approaches:-

1, like adding a rule in dispatcher like:- this worked for me.

/0046 { /type "deny" /glob "GET *.mp4/*" }

2, Adding a rewrite rule on the apache. it also worked but i it is creating issue some times.

RewriteRule ^(/.*\.(png|gif|jpg|mp4))/$ $1

 

Thanks,

viki

 

Change your second rule like which will work for all file type without any problem

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