Skip to content

Create a PHP site to transfer information of subscription links

HiddifyManager is based on the principle of reducing the possibility of server filtering as much as possible. One of the practical ways in this field is to separate configurations from subscription links. In this case, your client will always receive the latest configuration information through the subscription link. Now suppose the subscription link was not available for any reason, in this case a PHP site can be brought up and used to transfer the subscription link information (and not the config). The schematic for doing this is as follows.

php site for sub-link

Steps to do the work

To create a PHP site and use it for the subscription link, you must first do a Google search and find free sites that provide free PHP service. find.

  • Choose one of the sites.
  • Create your account there.
  • Then create a PHP hosting service in it. This work has similar steps in different sites and is almost simple. To create this service, you must create a unique address on one of the domains of that provider.
  • After that, your service will be created.
  • After creating the service, edit its files and place the following two files in the main path of your service.
  • Note: If you don't see any .htaccess and index.php files, you need to create these files manually.

  • Make sure that .htaccess file has a dot before its name and if you create it, consider this point.

Code for .htaccess file

RewriteEngine On
RewriteRule ^(.*)$ index.php?url=$1 [L]

Code for index.php file


if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') {
     exit('Access Forbidden - HTTPS is required.');

$server_domain = "";

$domain = $_SERVER['HTTP_HOST'];
$url = $server_domain . $_SERVER['REQUEST_URI'];
$userAgent = $_SERVER['HTTP_USER_AGENT'];

$ch = curl_init();
curl_setopt_array($ch, [
     CURLOPT_URL => $url,
     CURLOPT_HEADERFUNCTION => function($curl, $header) {
         return strlen($header);

$headers = [
     "CF-Connecting-IP: $ip",
     "Host: $domain",
     "User-Agent: $userAgent",
foreach ($_SERVER as $key => $value) {
     if (strpos($key, 'HTTP_') === 0) {
         $header = str_replace('_', '-', substr($key, 5));
         $headers[] = "$header: $value";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
     exit('Internal Server Error');

echo $response;


Be careful:

Replace your subscription domain in the above PHP code.

In the PHP site settings, the PHP version should be 8 or higher.

The CURL option should be turned on in the PHP settings of your host.

  • Then save the settings.
  • At this point, if you check the ssl settings for your domain in this PHP provider; You will probably notice that it takes some time for the certificate to be assigned.
  • Now to use; Copy the link related to your created domain in this provider and then copy the section after the address from your admin link in the panel and paste it at the end of your PHP link. The panel returns with the PHP address. For example, suppose your PHP domain is:

And the link of your admin panel should be like this:

Your PHP address to reach the panel will be as follows:

Very important note: if your PHP domain is not yet certified on the provider's site; This address does not open with https and you can open it with http for testing, but be sure to use https to use. So you have to wait for the certificate to be assigned.

  • After performing the above test, register the domain in your HiFi Manager in the Domains section so that the server will get SSL for it and its connection will be completely secure.

  • After doing this, you can add this link as a subscription link to your client apps.

  • The work is done. Now you have an address that is connected to your server and is practically unfilterable.

Last update: April 17, 2024