S
S
Sergey Zverev2022-04-16 01:32:18
AJAX
Sergey Zverev, 2022-04-16 01:32:18

Error 403 (Forbidden), how to give access to php file for ajax?

When making an ajax request, throw an error:

POST https://test.ru/bitrix/modules/test/admin/ajax.php 403 (Forbidden)

BX.ajax.post('/bitrix/modules/<?=$module_id?>/admin/ajax.php',data,function(result){});

I tried to give access using /bitrix/modules/test/admin/.htaccess :
Satisfy any 
order allow,deny 
allow from all


But the error didn't go away.
How to provide access to the ajax.php file if it is located in the modules folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2022-04-16
@Firsov36

Develop your own modules in the /local/modules folder, not in the /bitrix/modules folder.
In the ajax.php file, you are most likely connecting the Bitrix core, and you didn’t specify access to read the file at the level of Bitrix users or didn’t set a constant in the file so as not to check the rights (which is not safe in some cases).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question