In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the method of modifying the template path of Dede website, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
How to modify the template path of Dede website?
I believe that there are many websites that use Dede architecture, and most of the time we directly copy a templets\ default folder to modify the name to achieve the purpose of modifying the template path, but if we make the template, often many places are not considered carefully, because not all functions can be used. Access some functions that do not have a template, and sometimes expose the real path of the template
1. Modify template files in batches
Method, using the batch modification tool. For example, if your template directory is templets\ xahot.net, then you need to batch replace {dede:global.cfg_templets_skin/} and $cfg_templets_skin;? > to / templets/default or other security paths. PS, there are a lot of batch modification tools online, and the server I use is easy to use (not AD).
2. Put the template into the database
It is also good to use the custom tag feature that comes with the dede program to prevent templates from being downloaded. To put it simply, put the real template into the database, html template is just a shell without content.
Specific steps: go to the dede background and create a new custom tag named xahot. As for the content, you can copy all the contents of the template file into it. Then empty the template and write the custom tag code {dede:mytag ismake='yes'/}. Now even if the template is downloaded, only this custom tag will be leaked.
3. Use the pseudo-static (url rewrite) feature of the site to reset the link
A, the server supports creating an .htaccess in the root directory of the .htaccess (linux) file, and modify it as follows
For example, my template file is in the / templest/xahot.net/ directory.
Now I'm going to set a rule that whenever you access any file in the template directory, the home page content is displayed.
Change the .htaccess file:
RewriteEngine OnRewriteBase / ErrorDocument 404 / RewriteRule templest/xa /
Note the last rule, which means that as long as the address you visit contains "templets/xa", the contents of the home page will be displayed.
You can see that my template directory name is not fully written, as long as it starts with xa, which protects the template without exposing its path.
B, IIS website method httpd.ini writing (specific httpd.ini placement is not too much, you can search it yourself)
[ISAPI_Rewrite] # 3600 = 1 hourCacheClockRate 3600RepeatLimit 32RewriteRule ^ (. *) / aa? (. +) $1/templest/xa$2.htm [L]
IIS can only return 404 error page. Set a 404 page first and let him return it casually (actual test is available)
For those who like to guess the path, no matter how to guess, return an error page!
Summary: the combination of the first method and the last method is easy to use and effective, and it is convenient to modify the template. The second one is troublesome to modify and is not recommended.
Thank you for reading this article carefully. I hope the editor will share the content of the method of modifying the template path on the Dede website. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!
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.