Answer the question
In order to leave comments, you need to log in
How to connect a site in a subdirectory?
Good afternoon! There is a website, let's say example.ru. PHP mode is CGI. CMS - author's (the studio that made the site). I want to make a regional site through subfolders. I made a copy of the site and copied it to the folder: example.ru/almaty.
Then I changed $site in the config (config.php):
$site = "example.ru/almaty";
$host = "localhost";
$user = "...";
$passwd = "....;
$dbname = "....;
include_once $_SERVER['DOCUMENT_ROOT']."almaty/config.php";
include_once $_SERVER['DOCUMENT_ROOT'].'/almaty/config.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/almaty/db.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/almaty/classes/Core/Core.php';
$root = $_SERVER['DOCUMENT_ROOT'].'/almaty';
- in it, which is further used to determine the location of files and folders, such as:include_once $SITE->root.'/lib/lib.php'; или
include($root."/components/".$components."/frontend/main.php");
$ _SERVER['DOCUMENT_ROOT'].'/almaty'.
Answer the question
In order to leave comments, you need to log in
In general, I figured out - in the php file there was a protective check against copying the site. It was enough to tweak the code a little and everything loaded. Found a glitch with the help of commenting. I commented everything out, and uncommented it one block at a time until I saw which code returns a 404 error. And there it immediately became clear that this was a check.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question