<?php $menus = &JSite::getMenu(); $menu = $menus->getActive(); $pageclass = ""; if (is_object( $menu )) : $params = new JParameter( $menu->params ); $pageclass = $params->get( 'pageclass_sfx' ); endif; ?> </head> <body class="<?php echo $pageclass; ?>">Add a comment
The following are additions that I make to my default Joomla .htacess file. The first rule prevents visitors to see how my modules are arranged in Joomla. The second stops them from seeing the templates I have installed on my site. The XML rule is to make sure no one can read common extensions that I have installed (/administrator/components/com_#name#/#name#.xml) and checking if I'm running an old version that may have security exploits. The last and final set make Apache redirect the error pages to Joomla, because the default configuration redirects them to 404.shtml, which bypasses the Joomla error page, and also (if 404.shtml is missing) shows Apache,Linux, etc versions. The names themselves are superfluous, the only key is that they do not end in .shtml, and allow joomla to handle these errors.
###tp=1 prevention #####
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
###block template changing ###
RewriteCond %{QUERY_STRING} template=(.*)
RewriteRule ^(.*)$ index.php [F,L]
### Block XML File reading####
<Files ~ "\.xml$">
Order allow,deny
Deny from all
Satisfy All
</Files>
###Redirect apache error pages to joomla###
ErrorDocument 404 /not-found
ErrorDocument 403 /forbidden
ErrorDocument 401 /access-denied
ErrorDocument 500 /server-error
Special thanks to @brianteeman
Add a commentPage 2 of 2