Block query string debug=layout on dispatcher & AEM publish | Community
Skip to main content
Level 4
April 6, 2017
Solved

Block query string debug=layout on dispatcher & AEM publish

  • April 6, 2017
  • 3 replies
  • 3191 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by vjetty

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

3 replies

vjetty
vjettyAccepted solution
Level 4
April 7, 2017

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

MC_Stuff
Level 10
April 7, 2017

Hi rajeev,

Restrict based on query string. Sample at https://docs.adobe.com/docs/en/dispatcher/disp-config.html#RESTRICTING QUERY STRINGS 

Thanks,

Level 4
April 7, 2017

Worked like charm. Thank you for prompt response.