Friday, October 15, 2010

How to disable ?tp=1 in Joomla

2 ways to disable ?tp=1 in joomla:
1. Using the .htaccess file

 2. By a core hack




1. Using the .htaccess file

The first and easy method is using the .htraccess file. Most of you may have known that there is a file called htaccess.txt is in your Joomla root. Rename it to the .htaccess and open in favorite text editor  .Add the following code :


 ##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
##### End ?tp=1 prevention ######
 Please note that not every hosting is not supporting .htaceess and there is a chance that your site may goes down after incluiding this and also this trick will not work for all cases.



 2. A core hack

If you don't want to use the .htaccess and the plugin, you can do a core hack and that will prevent displaying the module positions. Go to /libraries/joomla/application/module/helper.php and look around line 200 for this code.
if(JRequest::getBool('tp')) {
$attribs['style'] .= ' outline';
}
and comment the $atttibs['style'] line.

Note that it is a core hack it will be overwritten if you update the Joomla version.  
Also there is templates written on Morph Framewok . This will prevent displaying the module positions along with a number of other hacks.

No comments:

Post a Comment