Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ingzly

Pages: [1]
1
PHP / 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.
ERR_TOO_MANY_REDIRECTS


NB:
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 "*"
</IfModule>

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]

Pages: [1]