Mautic: Infinite Redirect Loop on Setting

Created on 9 May 2017  路  17Comments  路  Source: mautic/mautic

What type of report is this:

| Q | A
| ---| ---
| Bug report? | Bug
| Feature request? |
| Enhancement? |

Description:

I am using vesta cpanel for running mautic which configures apache with nginx proxy.
When I have changed my mautic URL to https it alwats redirects to https://mymautic.com/s/login

Please help

If a bug:

| Q | A
| --- | ---
| Mautic version | 2.8.0
| PHP version | 7.0

Steps to reproduce:

  1. Install mautic on Sub Domain with SSL
  2. Change Mautic URL to https
  3. Delete Cache

Log errors:

There is no error logs in

bug

Most helpful comment

1) Open /www/mautic/app/config/local.php
2) Change 'site_url' => 'https://something.com' to 'site_url' => 'http://something.com',
(HTTPS>HTTP)
3) Delete cache: rm -rf /www/mautic/app/cache/*
4) Open site https://something.com/
5) Change back to https via : https://something.com/s/config/edit or /www/mautic/app/config/local.php

All 17 comments

I'm running Mautic with SSL on a subdomain and I don't have such problems. Could you double-check if it's not a server configuration issue?

I think it may be Server issue, I am using vestaCP it uses nginx for frontend and apache for backend

see here for details - https://www.mautic.org/community/index.php/7620-error-too-many-redirects-after-deleting-app-cache-directory/p1#p22899

Try to see if it even loads this method: https://github.com/mautic/mautic/blob/staging/app/bundles/UserBundle/Controller/SecurityController.php#L49

But the community won't be able to help if it is a server issue. Maybe ask support of the server.

@escopecz how can i check if loginAction() method loads?

I don't think It's a server configuration issue as api endpoints are working

Add to the method die('it loads'); and try to access the login page. If it writes the 'it loads' text, it means the method is loaded. You can move the die statement to the end of the method to see if the contents of that method is causing the redirect loop. This way you can find what line is causing it.

Ok let me try this

Thanks

screen shot 2017-05-09 at 4 33 14 pm
I added die statement still getting the redirect error
screen shot 2017-05-09 at 4 35 41 pm

What you say, maybe the problem?

@escopecz Today I edited index.php with die statement as shown in pic and page was working
screen shot 2017-05-13 at 12 58 00 pm

Please help, I think the server configuration is okay as i was able to see "hello" text on web page as die was executing but when i have put die statement at last line, i see the error too many redirects

Have you tried to clear the cache? Anything in the logs?

See https://mautic.org/docs/en/index.html

When you say that the API calls are working, do you use http for that?

Yes i cleared cache, when i am using mautic url as http everything works.

For mautic api call i am using https

Is there any problem with router or any headers that may be extra added in request?

If I keep mautic url at http, no issues after clearing cache.
If I change mautic utl to https, clear cache, and I get 301 redirect loop.

@lvnilesh I experience the exact same issue.

@stschindler https://github.com/mautic/mautic/issues/5285 resolved for me.

1) Open /www/mautic/app/config/local.php
2) Change 'site_url' => 'https://something.com' to 'site_url' => 'http://something.com',
(HTTPS>HTTP)
3) Delete cache: rm -rf /www/mautic/app/cache/*
4) Open site https://something.com/
5) Change back to https via : https://something.com/s/config/edit or /www/mautic/app/config/local.php

@Pytlicek works like a charm, however, how hard could it be to fix it in the code?

adding this in index.php solve this issue
$_SERVER['HTTPS'] = 'on';

https://github.com/mautic/mautic/issues/5285

Was this page helpful?
0 / 5 - 0 ratings