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!