0

So, I have a website working properly on my localhost but when I migrate it to hosted server I get too many redirects error. I've done migrations before and this never happend but this time. Difference is that the server has SSL certificate activated to my domain. Can this problem occur because I developed site on localhost with no SSL certificate and on HTTP protocol instead of HTTPS? How can I fix this or what is the proper way for deployment in this scenario? Thank you in advance.

  • I don't know if this difference in protocol is causing the problem, but to rule that out, try to run a search and replace in your DB, where you search for http://your-website.com and replace it with https://your-website.com (be sure to make a backup first). You can use this tool: interconnectit.com/products/… . Another thing you could check is whether your .htaccess is making any unnecessary redirects. – Bob Nov 20 '18 at 7:34
  • I did that DB part already and it did not work. I looked at .htaccess but since I don't understand it that well maybe I didn't know what I was searching for... – scodex Nov 20 '18 at 17:50
0

Try to set these settings in your wp-config.php:

define('WP_SITEURL', 'https://example.org');
define('WP_HOME', 'https://example.org');

Where https://example.org – your new domain

  • Tried already. Didn't work. – scodex Nov 19 '18 at 21:43
  • Ok, It seems that the problem related with your web-server. Do you use nginx or apache or something else? – Anton Lukin Nov 20 '18 at 9:25
  • Apache. Can the reason be php version difference between server and my local machine? I made a brand new wordpress installation on live server and redo building process and I found out that elementor plugin that I used required newer php version than the one server was running at the time. I guess that should not make too many redirects error and instead warn me after deployment about php version, but what do you think? – scodex Nov 20 '18 at 17:47
  • I don't thing that problem can be with php version. Most likely your apache configs have some mistake. Try to use default config first of all – Anton Lukin Nov 21 '18 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.