Answer the question
In order to leave comments, you need to log in
How to organize url contexts by address on modx revo?
I welcome everyone!
I would like to implement it like this:
domain name.ru/test opens a new context when opened.
Made settings for the context:
Key: demo
base_url: /test
http_host:
domain name.ru/test site_start: 387
site_url http://domain name.ru/test
Plugin for OnHandleRequest event
<?php
if ($modx->context->key == 'mgr') {return;}
elseif ($modx->event->name == 'OnHandleRequest') {
$var = $modx->getOption('request_param_alias', null, 'q');
$request = $_REQUEST[$var];
if (strpos($request, 'test') === 0) {
$modx->switchContext('demo');
$_REQUEST[$var] = substr($request, 8);
}
}
Answer the question
In order to leave comments, you need to log in
Thank you. I decided myself. It was necessary to properly configure htaccess and create a folder with 3 files, and this plugin can not be used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question