We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Too many redirects / change to SSL | Forum

Dimitris Salas
Dimitris Salas May 18 '21
Hello , I recently added SSL certificate to my website and I am trying to change it to HTTPS.

When I change the config.php from http to https i get the error too many redirects


Same goes with every change in the .htaccess.


I am using an apache server. Anyone have any idea how to I fix it?

Chris_W
Chris_W May 18 '21
Post the first few lines of your config.php and your .htaccess so we can have a look. Not database info.


config.php first line should be:


define('OW_URL_HOME', 'https://steveclean.biz:443/');


Replacing URL with your domain.


.htaccess should start like this:


<IfModule mod_rewrite.c>

Options +FollowSymLinks

RewriteEngine On

</IfModule>


<IfModule mod_headers.c>

Header always set Content-Security-Policy "upgrade-insecure-requests;"

</IfModule>


# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.) - except let's encrypt challenge

 RedirectMatch 403 ^/?\.(?!well-known/acme-challenge/[\w-]{43}$)


 RewriteCond %{HTTPS} !on RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]



The Forum post is edited by Chris_W May 18 '21
Chris_W
Chris_W May 18 '21
If you use the video plugin, you also need to replace: /ow_plugins/video/classes/video_providers.php 

with the attached copy, to prevent your site trying to pull video content and thumbnails from non SSL sites.

Attachments:
  video_providers.php.zip (3Kb)
Dimitris Salas
Dimitris Salas May 19 '21

Hello


define('OW_URL_HOME''http://www.qnest.eu/socialqnest/');

I do change it to https: but when i do it says too many redirects



Options +FollowSymLinks

RewriteEngine On


AddEncoding gzip .gz

AddEncoding gzip .gzip

<FilesMatch "\.(js.gz|js.gzip)$">

  ForceType text/javascript

</FilesMatch>

<FilesMatch "\.(css.gz|css.gzip)$">

  ForceType text/css

</FilesMatch>



RewriteCond %{REQUEST_URI} !^/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/

RewriteCond %{REQUEST_URI} !/ow_cron/run\.php

RewriteCond %{REQUEST_URI} !/e500\.php

RewriteCond %{REQUEST_URI} !/captcha\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteRule (.*) index.php

Chris_W
Chris_W May 20 '21
Check in cPanel in the domains section that there are no redirects set up. If there is one that directs to an http URL it will cause a redirect loop from http to https and back. It should look like this with no redirect set.


If it is your main domain, check the force https setting.


The Forum post is edited by Chris_W May 20 '21