Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does discuz get rid of portal.php?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to remove portal.php from discuz. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Discuz's method to remove "portal.php": first set the default home page to "unavailable" in the navigation settings in the system background; then open "index.php" and modify the content to "$_ ENV ['domain'] [' defaultindex']".

Discuz cancels the portal.php in the portal home page url

These days, I am going to build a vegetarian website with discuz. After everything is ready, I always bring portal.php to visit the portal of discuz. It may be a professional problem, and it is too obnoxious in url. And discuz is a product that search engines have been resisting all the time. In order to get a better seo from the new site, I decided to remove portal.php from url, as follows:

First, set it in the navigation settings in the system background, set the default home page to "unavailable", then customize the home page and fill in "/" in the link.

Find it in the index.php of the root directory of the program

$url = empty ($_ ENV ['domain'] [' app'] ['default'])? (! empty ($_ ENV [' domain'] ['defaultindex'])? $_ ENV [' domain'] ['defaultindex']:' forum.php'): 'http://'.$_ENV['domain']['app']['default'];

Modified to:

$_ ENV ['curapp'] = str_replace (' .php','', $_ ENV ['domain'] [' defaultindex'])

But this will not solve the problem of portal.php in url.

Therefore, through analysis, you can set the default appindex of discuz, or modify it in the index.php file.

$_ ENV ['curapp'] =' portal'; / / add a statement that sets curapp to portal by default, otherwise it defaults to forumrequire'. /'. $_ ENV ['curapp'].' .php'

Why should I set it this way, because I don't want to use the forum function in the early days.

Finally, add a statement in forum.php to block forum access.

Header ("LOCATION: http://www.zt520.net");exit(); above is how the discuz shared by the editor removes portal.php. If you happen to have similar doubts, you might as well refer to the above analysis to understand." If you want to know more about it, you are welcome to follow the industry information channel.

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.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report