Home  >  Article  >  CMS Tutorial  >  discuzHow to remove portal.php

discuzHow to remove portal.php

藏色散人
藏色散人Original
2020-08-05 09:25:564304browse

discuz Method to remove "portal.php": First, set the default homepage to "Unavailable" in the navigation settings of the system background; then open "index.php" and modify the content to "$_ENV[ 'domain']['defaultindex']" is enough.

discuzHow to remove portal.php

Recommendation: "discuz Tutorial"

discuz Cancel portal.php# in the portal homepage url

## I am planning to use discuz to build a vegetarian website in the past few days. After everything is ready, I always bring portal.php when I visit the portal of discuz. It may be a professional problem. I always bring it in the URL. It feels like It's too eye-catching, and discuz is a product that search engines have always resisted. In order to achieve better SEO for the new site, I decided to remove portal.php from the URL. The operation method is as follows:

1. In the system Set it in the background navigation settings, set the default homepage to "Unavailable", then customize a homepage and fill in "/"

discuzHow to remove portal.php

in the link. 2. In the program Find

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

in the index.php of the root directory and modify it to:

$_ENV['curapp'] = str_replace('.php', '', $_ENV['domain']['defaultindex']);

However, this still cannot solve the problem of portal.php in the url.

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

$_ENV['curapp'] = 'portal'; //添加这么一条语句,将curapp默认设置为portal,否则默认是forum
require './'.$_ENV['curapp'].'.php';

Why should I set it like this, because I don’t want to use the forum in the early stage Function.

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

header("LOCATION:http://www.zt520.net");
exit();

The above is the detailed content of discuzHow to remove portal.php. 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