Author Topic: php script does not run  (Read 3098 times)

0 Members and 1 Guest are viewing this topic.

php script does not run
« on: July 01, 2020, 12:37:57 PM »
Hi all

When I upload php script on a shared hosting with cpanel , the script works fine.
But when I uploaded the script on vps with cwp control panel the site does not open and these messages appear to me.

redirected you too many times.

When i change a file name .htaccess to any other name, the site open and the site dashboard does not open.

.htaccess file

Code: [Select]
RewriteEngine On
Options -Indexes
<IfModule mod_headers.c>
  Header set Access-Control-Allow-Origin "*"

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

RewriteRule ^([0-9a-zA-Z-_-]+)$ handler.php?slug=$1

RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#Now, rewrite to HTTPS if www present:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]