Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
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.