Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How to disable debug_profile and debug_memory outputs in live sites?


Reply

5 Posts   1182 Views

Avatar
drx

4 February 2010 at 8:26am (Last edited: 4 February 2010 8:27am), Community Member, 7 Posts

Is it possible to deactivate debug_* outputs on live sites?

Even on silverstripe.org you can take a look behind:

http://www.silverstripe.org/?debug_profile
http://www.silverstripe.org/?debug_memory=1

drx

Avatar
OwenW

4 February 2010 at 2:10pm Community Member, 45 Posts

Hi drx,

Here is a quick solution to do what you want using a rewrite rule within the .htacess;

RewriteCond %{QUERY_STRING} ^debug(.*)
RewriteRule (.*) http://example.com/silverstripe/404? [R=301,L]

Chuck these two lines in after the RewriteBase and any requests with a query string of debug will get redirected to example.com/silverstripe/404.

Hope that helps.

Cheers
Owen

Avatar
drx

5 February 2010 at 3:02am Community Member, 7 Posts

hi owen - nice *workaround*.
that helps.
drx

Avatar
Hamish

5 February 2010 at 7:55am Community Member, 712 Posts

Refer also:

[url]http://groups.google.com/group/silverstripe-dev/browse_thread/thread/d1a61dd53c6aff46[/url]

Avatar
Hamish

5 February 2010 at 8:05am Community Member, 712 Posts

Btw, in 2.4 both features will be dev site only.