Home > CMS Tutorial > Discuz > body text

discuzHow to remove portal.php

藏色散人
Release: 2021-02-01 11:58:25
Original
4445 people have browsed it

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'];
Copy after login

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

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

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';
Copy after login

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();
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!