Ajax so'rov https orqali ishlamayapti (error: 500)

0 ovoz
25 marta ko‘rilgan
so‘radi 06 sentabr parmonov98 (850 bal)

RewriteEngine On
AddDefaultCharset utf-8

#First rewrite any request to the wrong domain to use the correct one (here www.)
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off

RewriteCond %{REQUEST_URI} !^/query.php$

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ /?mainurl=$1 [QSA,L]

 yuqorida htaccess fayli kodi.

menga domain.uz/file.php ga ajax orqali GET metod bilan so'rov yuborilib response olinadi.lokalda ishladi.https hostingga joylagandan so'ng. filedan 500 error qaytyapti.

nima qilish mumkin?! nima uchun ajax so'rov https ishlamayapti.Ajax so'rov bo'yicha info o'qidim lekin https orqali ham bir xil bo'lyapti bog'lanish.

js code:

function ajax_search(string){

console.log(string);

const ajax = new XMLHttpRequest();

let input = document.getElementById('search_input').value;

console.log(input);

ajax.onreadystatechange = function () {

switch(ajax.readyState){

case 0: 

console.log('0.request not initialized!');

break;

case 1: 

console.log('1.connection established!');

break;

case 2: 

console.log('2.request received !');

break;

case 3: 

console.log('3.processing request!');

break;

case 4: 

console.log('4.request finished and response is ready!');

if(ajax.status == 200){

console.log('Everything is OK!');

let res = document.getElementById('search-result-block');

res.innerHTML = ajax.responseText;

}else{

console.log('There is an error. it seems the requested file does not exist!');

}

break;

}

}

let url = 'https://domain.uz./file.php?query='+input;

ajax.open('GET', url, true);

ajax.send();

}

1 ta javob

0 ovoz
javob berdi 06 sentabr Неъматжон (5 bal)
tahrirlandi 06 sentabr Неъматжон
http да ишлаяптими?
Агар ишлаётган бўлса, Уша гет запросни https билан браузердан тўғридан-тўғри жўнатиб кўринг-чи? Агар яна 500 бўлса, сертификатдан эмасмикин?
izoh qoldirdi 06 sentabr parmonov98 (850 bal)
sertifikat, screen:
http://img.uz/s?c6dam0c

Assalomu alaykum, yordam.uz saytimizga xush kelibsiz.

Bu saytda o`zingizni qiziqtirgan savollarga javob olishingiz va o`z sohangiz bo`yicha savollarga javob berishingiz mumkin.

Bizning Oilamizga a'zo bo`lganingiz uchun chuqur Minnatdorchilik bildiramiz !!!

Telegram kanal YordamUzRss

...