In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the anti-theft methods of weaving dream DedeCMS templates. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Dream weaving DedeCMS template how to guard against theft?
Dream template anti-theft method one of the system file repair method:
The method of repairing system files is a bit more troublesome. It is also recommended to do so only if you are familiar with the DedeCMS system. Because the template we do is often not comprehensive, for example, when our station only has an article model, then we usually don't make other model styles (such as software, mall, atlas, etc.), so in this case, when users visit the file path that we do not exist, it is possible to expose the template directory of the site.
Our solution is to delete the prompt in the specific file (and finally comment it through the PHP comment character). For example, in the content page parsing file (/ include / arc.archives.class.php), there is the following paragraph:
The following is the referenced content:
The code is as follows:
If (! File_exists ($tempfile) | |! Is_file ($tempfile)) {echo "document ID: {$this- > Fields ['id']}-{$this- > TypeLink- > TypeInfos [' typename']}-{$this- > Fields ['title']}"; echo "template file does not exist and the document cannot be parsed!" ; exit ();}
Then you can comment them out, such as:
The following is the referenced content:
The code is as follows:
If (! File_exists ($tempfile) | |! Is_file ($tempfile) {/ / echo "document ID: {$this- > Fields ['id']}-{$this- > TypeLink- > TypeInfos [' typename']}-{$this- > Fields ['title']}"; / / echo "the template file does not exist and the document cannot be parsed!" ; exit ();}
The second method of anti-theft of dream template is to store the content of the template:
This method is more convenient than the previous one. To put it simply, it is loaded using the custom tags (mytag) of the DedeCMS system. The way to do this is to create a new custom tag (mytag), and then copy all the code in the template file we need to hide into the contents of the custom tag.
Then, all the code in the template file you just needed to hide is emptied and replaced with the following code:
The following is the referenced content:
The code is as follows:
{dede:mytag name='list' ismake='yes'/}
The red bold list is the tag name of the custom tag (mytag)! In this way, even if it is guessed to the template path, it will be an unusable template after download. Because it cannot know the specific content of your macro tag, this specific content has been stored in the database.
This method has basically completed the hiding of the template, and it is also recommended that we use this method.
Dream template anti-theft method 3: 301 redirect jump:
This is simpler and more effective than the above two methods, but has special requirements for your server environment: you must support a custom configuration of .htaccess or httpd.ini-URL rewriting. Let's take .htaccess as an example, for example, if your template directory is: / templets/xuewl_com/, then you can use the following code to redirect:
The code is as follows:
RewriteEngineOnRewriteBase/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;}
Where http://noniu.com is the URL you want to jump to.
Dream template anti-theft method IV document 403 prohibition method:
The 403 method is to prevent directory files from being read, requiring the host to support .htaccess files. We know that the template of dream weaving is a file with the suffix .htm. As long as the browser is forbidden to load .htm files in templets, the template can be protected against theft. The way to do this is to place an .htaccess file in the templets folder. The contents of the .htaccess file are as follows:
The code is as follows:
Order Allow,DenyDeny from all on weaving dreams DedeCMS template anti-theft methods to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.