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

How does dedecms bind a second-level domain name

Release: 2019-07-31 11:20:20
Original
3363 people have browsed it

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

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

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

Modify the last sentence of code above to:

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

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!

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