Browse Source

Si on ignore les www, les ignorer aussi dans les urls de la config multidomaines

spip4.1
nicod_ 1 year ago
parent
commit
03d8d96fab
  1. 1
      multidomaines_options.php
  2. 3
      urls/arbo_multidomaines.php

1
multidomaines_options.php

@ -34,6 +34,7 @@ if (is_array($options)) {
$host = $_SERVER['HTTP_HOST'];
if (defined('_MULTIDOMAINE_IGNORE_WWW') && _MULTIDOMAINE_IGNORE_WWW) {
$host = preg_replace('/^www\./','',$host);
$partie_url['host'] = preg_replace('/^www\./','',$partie_url['host']);
}
if ($partie_url['host'] == $host AND $partie_url['port'] == $_SERVER['SERVER_PORT']) {
if (isset($config['squelette']) and $config['squelette']) {

3
urls/arbo_multidomaines.php

@ -765,6 +765,9 @@ function urls_arbo_multidomaines_dist($i, $entite, $args = '', $ancre = '') {
foreach($cfg_multi as $id_rubrique_multi => $v) {
// Si c'est bien un domaine, retrouver son URL
$composants_url_multi = parse_url($v['url']);
if (defined('_MULTIDOMAINE_IGNORE_WWW') && _MULTIDOMAINE_IGNORE_WWW) {
$composants_url_multi['host'] = preg_replace('/^www\./','',$composants_url_multi['host']);
}
if (
$composants_url_multi['host'] === $host
and $url_domaine = sql_getfetsel(

Loading…
Cancel
Save