search
HomeCMS TutorialDEDECMSHow to prevent theft of DedeCMS template
How to prevent theft of DedeCMS templateNov 18, 2019 am 11:14 AM
dream weaving

How to prevent theft of DedeCMS template

How to prevent theft of DedeCMS template?

One of the anti-theft methods of DedeCMS template is system file repair method:

System file patching method is a bit more troublesome. It also requires a certain degree of familiarity with the DedeCMS system before this is recommended. Because the templates we make are often not comprehensive. For example, when our website only has article models, we usually don’t make styles for other models (such as software, shopping malls, photo albums, etc.), so here we In this case, when a user accesses a file path that does not exist, the template directory of the website may be exposed.

Recommendation: "dedecms usage tutorial"

Then our solution is to delete the prompts in the specific files (finally comment through PHP comments) , for example, in the content page parsing file (/include /arc.archives.class.php), there is the following paragraph:

The following is the quoted content:

The code is as follows:

if(!file_exists($tempfile)||!is_file($tempfile))
{
echo “文档ID:{$this->Fields[‘id’]} - {$this->TypeLink->TypeInfos[‘typename’]} - {$this->Fields[‘title’]}”;
echo “模板文件不存在,无法解析文档!”;
exit();
}

Then you can comment them out, such as:

The following is the quoted content:

The code is as follows:

if(!file_exists($tempfile)||!is_file($tempfile))
{
// echo “文档ID:{$this->Fields[‘id’]} - {$this->TypeLink->TypeInfos[‘typename’]} - {$this->Fields[‘title’]}”;
// echo “模板文件不存在,无法解析文档!”;
exit();
}

Dream Weaver Template Anti-theft method two: warehousing template content:

This method is more convenient than the previous one. To put it simply, it is loaded using the custom tag (mytag) of the DedeCMS system. The specific implementation method is to create a new custom tag (mytag), and then copy all the code in the template file we need to hide into the content of the custom tag.

Then, clear all the code in the template file that needs to be hidden just now and replace it with the following code:

The following is the quoted content:

The code is as follows:

{dede:mytag name=‘list’ ismake=‘yes’/}

The list in bold red is the tag name of the custom tag (mytag)! In this way, even if someone guesses the template path, the template will be unusable after downloading. Because it cannot know the specific content of your macro tag, this specific content has been stored in the database.

This method can basically complete the hiding of the template, and it is also recommended that everyone adopt this method.

Dreamweaver template anti-theft method No. 3 301 redirect jump:

This is simpler and more effective than the above two methods, but it has special effects on your server environment. Requirements: Must support custom configuration of .htaccess or httpd.ini - URL rewriting technology. We take .htaccess as an example. For example, if your template directory is: /templets/xuewl_com/, then you can use the following code to perform 301 redirection:

The code is as follows:

RewriteEngineOn
RewriteBase/
ErrorDocument404/
RewriteRule templets/xuewl_com /

Nginx 301 redirect domain name:

Add the following code to the Nginx extension settings (server section):

The code is as follows:

location ~*^/templets {
rewrite ^/templets/(.*)$ http://noniu.com permanent;
}

Among them, http://noniu.com is yours The URL you want to jump to.

Dream Weaver Template Anti-Theft Method 4: File 403 prohibition method:

403 method is to prohibit directory files from being read, and the host needs to support .htaccess files. We know that Dreamweaver's templates are files with the .htm suffix. As long as the browser is prohibited from loading .htm files in templets, template theft prevention can be achieved. The specific method is to place an .htaccess file in the templets folder. The content of the .htaccess file is as follows:

The code is as follows:

<Files *.html>
Order Allow,Deny
Deny from all

The above is the detailed content of How to prevent theft of DedeCMS template. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
织梦如何导入css织梦如何导入cssDec 03, 2020 pm 04:03 PM

织梦导入css的方法:1、将HTML模板文件放到“templets”文件夹中;2、将HTML文件的后缀改成“.htm”;3、在原先的样式路径前加上“{dede:global.cfg_templets_skin/}”即可。

CMS织梦数据库文件恢复方法详解CMS织梦数据库文件恢复方法详解Mar 13, 2024 pm 03:15 PM

数据库是网站运行的核心,存储着用户数据、文章内容等重要信息,因此在网站运营过程中,数据库文件的备份和恢复显得尤为重要。对于使用织梦CMS搭建的网站来说,数据库文件的恢复同样是一项关键任务。本文将详细介绍织梦CMS数据库文件的恢复方法,并提供具体的代码示例,帮助用户迅速恢复网站数据,保障网站正常运行。一、备份数据库文件在恢复数据库文件之前,首先需要确保已经进行

一文探讨织梦php5.7版本的新特性和优势一文探讨织梦php5.7版本的新特性和优势Mar 21, 2023 am 09:36 AM

织梦是一个非常著名的CMS,由于其简单易用的特点被许多网站使用,它的后台采用php进行开发,而最新的官方版本是织梦php 5.7。在本文中,我们将探讨织梦php5.7版本的新特性和优势。

织梦安装php7.0不成功怎么解决织梦安装php7.0不成功怎么解决Mar 23, 2023 am 11:11 AM

安装织梦时遇到问题是一个常见的情况,其中一个可能的问题就是无法成功安装php7.0。在本文中,我们将介绍如何解决这个问题。

浅析织梦所需的PHP版本和组件数量浅析织梦所需的PHP版本和组件数量Mar 21, 2023 am 10:50 AM

织梦是一款非常流行的网站建设系统,其架构是基于PHP语言构建的。因此,织梦需要PHP来运行。那么,具体来讲,织梦需要多少个PHP呢?这并不是一个简单的问题。本文将会从以下几个方面介绍织梦需要的PHP版本和组件数量。

织梦需要php什么版本织梦需要php什么版本Jun 06, 2023 pm 01:20 PM

织梦需要PHP 5.2版本及以上,其安装方法:1、首先安装PHP并配置好环境;2、下载DedeCMS安装包,并解压到网站根目录;3、打开网站URL,按照提示完成安装;4、安装完成后,通过http://localhost/yourwebsite访问即可访问到织梦后台。

掌握织梦PHP5的关键要点掌握织梦PHP5的关键要点Mar 26, 2024 am 11:12 AM

织梦CMS是一款基于PHP5开发的开源内容管理系统,被广泛应用于网站建设领域。掌握织梦PHP5的关键要点,对于开发者来说非常重要。本文将介绍一些关键要点,并提供具体的代码示例,帮助读者更好地理解和应用织梦PHP5。一、文件包含在织梦CMS的开发中,经常需要在不同的文件之间进行数据共享和代码重用。PHP的文件包含功能是解决这个问题的有效方法。在织梦CMS中,常

cms是织梦吗cms是织梦吗Mar 01, 2023 am 09:58 AM

cms不是织梦,cms是指内容管理系统,而织梦只是cms的一种;织梦cms就是指织梦内容管理系统,而内容管理系统是一种位于WEB前端和后端办公系统或流程之间的软件系统;cms具有许多基于模板的优秀设计,可以加快网站开发的速度和减少开发的成本。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools