Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Block query string debug=layout on dispatcher & AEM publish

Avatar

Level 4

I want to block access to all requests having querystring matching debug on dispatcher and redirect those requests to homepage after stripping this query string. Need help on this.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi, Rajeev

In your httpd ".conf" file, inside your VirtualHost tag - Write these rules.

RewriteEngine   On

RewriteCond %{QUERY_STRING} debug=layout

RewriteRule .* /? [R,L]

What it will do - For Eg.,

If your request url is - http://www.example.com/homepage.html?debug=layout

then it will redirect the url to http://www.example.com

Hope this helps! 

Thanks,

Vamsi

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

Hi, Rajeev

In your httpd ".conf" file, inside your VirtualHost tag - Write these rules.

RewriteEngine   On

RewriteCond %{QUERY_STRING} debug=layout

RewriteRule .* /? [R,L]

What it will do - For Eg.,

If your request url is - http://www.example.com/homepage.html?debug=layout

then it will redirect the url to http://www.example.com

Hope this helps! 

Thanks,

Vamsi

Avatar

Level 4

Worked like charm. Thank you for prompt response.