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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

template for Security not found


Go to End


3 Posts   1898 Views

Avatar
BenWu

Community Member, 97 Posts

25 October 2012 at 10:54pm

My customer found a horriable page http://mysite.com/Security

and he got this error msg:
[Notice] Undefined property: Security::$template
GET /Security

followed by 404.

how to redirect /Security to the 404 specified in the CMS?

Avatar
gaethofs

Community Member, 9 Posts

4 November 2012 at 2:53am

Did you modify or extend the default Controller.ss template?
What version of SS are you currently using?

Avatar
BenWu

Community Member, 97 Posts

8 November 2012 at 11:19pm

I am using 3.0.2 release 2. I did not extend the default Controller.ss.

For now, I have to put this in my .htaccess to force a redirect

RewriteCond %{REQUEST_URI} ^/Security$
RewriteRule ^(.*)$ /notfound/%1 [PT]
RewriteCond %{REQUEST_URI} ^/Security/$
RewriteRule ^(.*)$ /notfound/%1 [PT]