R
R
ragnar_ok2019-08-11 20:33:41
1C-Bitrix
ragnar_ok, 2019-08-11 20:33:41

Bitrix urlrewrite.php: how to connect a folder?

What rule urlrewrite.phpto specify so that CONDITIONnot the physically existing script specified in is connected to the address specified in PATH, but the entire folder?
This code works:

$arUrlRewrite = [
  [
    'CONDITION' => '#^/folder_ru/#',
    'PATH' => '/folder_en/index.php',
  ],
];

The problem is that I also need to include .section.phpand *.menu.phpwhich are in /folder_en . When using the above rule, items from the menu disappear because *.menu.php.
This code only works when /folder_ru doesn't exist . I tried not to delete the /folder_ru folder . Then the menu .section.phpworks. But in this case, the above script does not work. Required : to connect the
/folder_en/index.php script to the /folder_ru address . In addition, you need to display menu items *.menu.phpand rules from .section.php.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2019-08-12
@ragnar_ok

Urlrewrite.php redirects user requests, and the .section.php and *.menu.php files are included in php, there is no direct access to them, so there is nothing to redirect.
If you want files from folder_en to be available in folder_ru, make a symbolic link to them in folder_ru. Almost all hostings allow you to do this operation, and there’s nothing to say about the server.
Command "ln -s [source_file] [reference_file]"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question