Home  >  Article  >  CMS Tutorial  >  How does dedecms bind a second-level domain name

How does dedecms bind a second-level domain name

尚
Original
2019-07-31 11:20:203178browse

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
Previous article:How to open dedecmsNext article:How to open dedecms