search
HomeCMS TutorialDEDECMSHow does dedecms bind a second-level domain name

How does dedecms bind a second-level domain name

dedecms can realize multi-level domain names and binding of different domain names, and it can be done with just one set of programs. In this way, it will be best to use dede to make website groups in the future, with the same theme. For the website, just use one set of dede.

DedeCMS column is bound to the second-level domain name

The first step is in the background-->System-->Basic Parameters-->Core In the settings, turn on (yes/no) to support multi-site. After turning on this option, attachments, column connections, and arclist content enable absolute URLs: , select Yes;

The second step, when adding or editing columns, Turn on multi-site support in the advanced options:, select Yes, (please check whether multi-site is enabled!) Fill in the second-level domain name you want to use;

The third step, manually bind the second-level domain name in the space level domain name to your subdirectory;

The fourth step, this step is the most important, modify the program file/include/helpers/channelunit.herper.php:

In the function function GetFileUrl , modify line 73:

if($moresite==1)
{
$articleUrl = preg_replace("/^".$sitepath.'/', '', $articleUrl);
}

Replace the slash / with a semicolon' in the path regular expression, and the modification is as follows:

if($moresite==1)
{
$articleUrl = preg_replace("'^".$sitepath."'",'',$articleUrl);
}

Similarly modify the code around line 260:

if($GLOBALS['cfg_multi_site']=='Y')
{
if($siteurl=='') {
$siteurl = $GLOBALS['cfg_basehost'];
}
if($moresite==1 ) {
$reurl = preg_replace("/^".$sitepath."/", '', $reurl);

Modify the last sentence of code above to:

$reurl  = preg_replace("'^".$sitepath."'",'', $reurl);

After this modification, the correct second-level domain name file path can be generated.

Recommended: dedecms usage tutorial

The above is the detailed content of How does dedecms bind a second-level domain name. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment