Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
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.