if ( $modx->context->get( 'key' ) != 'mgr') {
$cntxt_param = $modx->getOption('context_param_alias', null, 'c');
if ( isset( $_REQUEST[$cntxt_param] ) && $_REQUEST[$cntxt_param] != '' ) {
switch ( $_REQUEST[$cntxt_param] ) {
case 'en':
$modx->switchContext('web');
$modx->setOption('cultureKey', 'en');
break;
case 'ar':
$modx->switchContext('Arabic');
$modx->setOption('cultureKey', 'ar');
break;
default:
$modx->switchContext('web');
$modx->setOption('cultureKey', 'en');
break;
}
}
}RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(en|ar)?(\/)?(.*)$ index.php?c=$1&q=$3 [L,QSA]This question has been answered by cottagestuff. See the first response.
RewriteEngine On
RewriteBase /ar/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^assets(.*)$ https://www.haram-alaqsa.com/assets$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^css(.*)$ https://www.haram-alaqsa.com/css$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^js(.*)$ https://www.haram-alaqsa.com/js$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^img(.*)$ https://www.haram-alaqsa.com/img$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^photos(.*)$ https://www.haram-alaqsa.com/photos$1 [L,QSA]
#FURL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
#Desperate attempt to solve the non-loading-homepage problem
RewriteRule ^ar/$ https://www.haram-alaqsa.com/ar/alaqsa.html [R=301,L]