DirectoryIndex index.php
Options +FollowSymLinks
Options -Indexes
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule (.*) https://%1/$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_URI} !=/server-info
RewriteRule ^.*$ index.php [L,QSA]
if ( SITE_URL != reset_url($_SERVER['HTTP_HOST']) ) {
header( "Location: https://" . SITE_URL . $_SERVER['REQUEST_URI'], true, 301 );
exit;
}
// прехвърляне сайта
if ( ! empty($_SERVER['REQUEST_URI']) && ($redirect = json_get("seo.redirect")) ) {
$request_uri = urldecode( trim($_SERVER['REQUEST_URI'], '/') );
foreach ( $redirect as $key => $val ) {
if ( $val[0] == $request_uri ) {
header( "Location: /" . $val[1], true, 301 );
exit;
}
}
unset( $redirect, $request_uri );
}
// основни модули
require WEB_DIR . '/engine/engine.php';
Options +FollowSymLinks
Options -Indexes
Options -MultiViews
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule (.*) http://%1/$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ index.php [L,QSA]
<?php
define ( 'ROOT_DIR', '../../..' );
define ( 'SITE_DIR', __DIR__ );
include_once ROOT_DIR . '/web/index.php';
?>
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Ticketa каза:Създадох чрез API2 добавяне на субдомейни и реших нещата.
Въпроса е че АПИ се логва чрез парола и потребител - това ме притеснява
Как мога да го направя да работи чрез ТОКЕН с ограничени права?
https://github.com/CpanelInc/xmlapi-php - ползвам това
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Create a subdomain.
$addsubdomain = $cpanel->api2(
'SubDomain', 'addsubdomain',
array(
'domain' => 'subdomain',
'rootdomain' => 'example.com',
'dir' => '/public_html/directory_name',
'disallowdot' => '1',
)
);