Help me fix ERR_TO_MANY_REDIRECTS and 500 Server Error

I have been getting frustrated with Cyberpanel for the last 4 to 5 hours I have been trying to add files in the file manager in one of my subdomains to create an admin panel for my android app. Here is what I am trying to do and what problem I face.

  1. First I created a subdomain and open the subdomain Cyberpanel I Installed the page open
    which means the domain was created successfully. Now I visited the file manager and deleted the default index.html file and upload my admin panel files. After this when I again open the domain I was continuously getting ERR_TOO_MANY_REDIRECTS then I go through many community posts regarding the same problem. What I understood this may occur due to the .htaccess so from the dashboard of the subdomain I open the redirect rule option and copy the rewrite rules and then delete the rule and save the file and load the domain the problem was still there so I again opened redirect rules and paste the code and save it and again load the website. Since then I am getting two new problems one is 500 Server Error and another one is ```
    Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”. Though I have installed the subdomain at PHP 8.1 I was still getting this error. I tried to edit the compose.json file and downgrade the PHP requirement but nothing worked.

  2. Sometimes when I deleted the default index.html file and uploaded the admin panel files I was again getting 505 Server Error message.

  3. I tried to remove the domain and add it again but nothing worked I changed the URL of the sub domain but it also does not worked

I checked the error log of my sub domain and it was like below

2022-08-19 04:57:08.854299 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/' refers to a static file with PATH_INFO [/].
2022-08-19 04:57:09.246071 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:09.578731 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:09.863150 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:10.151968 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:10.448201 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:10.756893 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:11.047344 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:11.371743 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:11.675553 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].
2022-08-19 04:57:11.959222 [ERROR] [189727] [172.70.174.81:17920] URI '/hap/config.json/404.html' refers to a static file with PATH_INFO [/404.html].

Welcome @pankajbcpsr Happy you are here

Go to List Websites → mywordpresswebsite.org → Manage → ReWrite Rules and remove every rule you see and add the following:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Refresh your website ideally the issue should go away.

As the error states you need PHP version greater than 8.1.0.

Go to List Websites → mywordpresswebsite.org → Manage → Change PHP and choose PHP 8.1.

Now open ssh terminal and make sure you have composer installed by running

$ /usr/local/lsws/lsphp81/bin/lsphp composer -V

Hey, @josephgodwinke Thanks for replying I did what you said to change the rewrite rules but the issue not solved it was showing the same issue and when I put the old rewrite rules the site now showing 500 Server error checked the error logs it is like above I shared

This is not related to cyberpanel. You have configuration files from your previous host check your wordpress files for config files from previous host.

It is not a wordpress site

What is it?

It includes php admin panel codes for an android app from Codecanyon

Consult them on how to deploy the code