ModX Revolution 2.5.x и мультидоменность

Здравствуйте
Делаю несколько сайтов на поддомене в одной админке
Настраивал по этой теме bezumkin.ru/sections/tips_and_tricks/2439/

Контекст WEB:

yadi.sk/i/-qqM5-hO3KPfNc


Контекст Camry:
yadi.sk/i/G_2fljPS3KPfaY


Код плагина:
<?php
// Работаем только на фронтенде
if ($modx->event->name != 'OnHandleRequest' || $modx->context->key == 'mgr') {return;}

// Определяем запрашиваемый хост
$host = $_SERVER['HTTP_HOST'];

// Выбираем контекст с настройкой base_url
$q = $modx->newQuery('modContextSetting', array('key' => 'http_host', 'value' => $host));
$q->select('context_key');

$tstart = microtime(true);
if ($q->prepare() && $q->stmt->execute()) {
	// Учитываем наш запрос в БД
	$modx->queryTime += microtime(true) - $tstart;
	$modx->executedQueries++;
	// Получаем ключ контекста
	if ($context = $q->stmt->fetch(PDO::FETCH_COLUMN)) {
		// Web инициализируется в index.php - на него переключаться не нужно
		if ($context != 'web') {
			$modx->switchContext($context);
		}
	}
}
.htaccess:

<IfModule mod_rewrite.c>
	 Options +FollowSymlinks
	 RewriteEngine On
	 RewriteBase /
	
	 RewriteCond %{HTTP_HOST} .
	 RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
	 RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
	

	</IfModule>
	
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
	
	<IfModule mod_expires.c>
	 ExpiresActive on
	
	# Perhaps better to whitelist expires rules? Perhaps.
	 ExpiresDefault "access plus 1 month"
	
	# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
 ExpiresByType text/cache-manifest "access plus 0 seconds"
	
# your document html 
	 ExpiresByType text/html "access plus 0 seconds"
	 
# data
	 ExpiresByType text/xml "access plus 0 seconds"
	 ExpiresByType application/xml "access plus 0 seconds"
	 ExpiresByType application/json "access plus 0 seconds"
	
	# rss feed
	 ExpiresByType application/rss+xml "access plus 1 hour"
	
	# favicon (cannot be renamed)
	 ExpiresByType image/x-icon "access plus 1 week"
	
	# media: images, video, audio
	 ExpiresByType image/gif "access plus 1 month"
	 ExpiresByType image/png "access plus 1 month"
	 ExpiresByType image/jpg "access plus 1 month"
	 ExpiresByType image/jpeg "access plus 1 month"
	 ExpiresByType video/ogg "access plus 1 month"
	 ExpiresByType audio/ogg "access plus 1 month"
	 ExpiresByType video/mp4 "access plus 1 month"
	 ExpiresByType video/webm "access plus 1 month"
	
	# webfonts
	 ExpiresByType font/truetype "access plus 1 month"
	 ExpiresByType font/opentype "access plus 1 month"
	 ExpiresByType font/woff "access plus 1 month"
	 ExpiresByType image/svg+xml "access plus 1 month"
	 ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
	
	 
	# css and javascript
	 ExpiresByType text/css "access plus 2 months"
	 ExpiresByType application/javascript "access plus 2 months"
	 ExpiresByType text/javascript "access plus 2 months"
	</IfModule>
При переходе на домен camry.site.ru перекидывает все равно на rav4.site.ru
MrKarandash
23 июня 2017, 11:40
modx.pro
1 129
0

Комментарии: 0

Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
0