Joseph
Joseph

Reputation: 3959

Wordpress redirects on Cloud9 IDE

I have migrated a wordpress site off of my server onto Cloud9 IDE, I have then used Search and replace to change the URL from http://www.domain.com to https://project-c9-username.c9.io

Now when I run the site I have a redirect loop.

I have searched all over the internet for a solution, most attempts to solve this issue involve changing the .htaccess file, however this does not seem to be the issue. I have made a working .htaccess and it makes no difference.

I am very confused as I have moved wordpress sites before and had no issues.

Let me know if this belongs on a different stack exchange site, because Cloud9 is unknown outside of development circles I didn't want to ask on a lesser known stack exchange site as I know it'll never get answered.

EDIT: After some more research adding this to wp-config.php makes the homepage accessible

define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
       $_SERVER['HTTPS']='on';

It seems the forced Cloud9 IDE SSL is causing my website to break apart.

Upvotes: 2

Views: 789

Answers (3)

zachdyer
zachdyer

Reputation: 611

I had the same issue because I didn't have the right port set on the site url and site home page. After I added the cloud9 port 8080 to the url it started working. So go to your wp-config.php file and add these two lines of code.

define('WP_HOME','https://project-c9-username.c9.io:8080');
define('WP_SITEURL','https://project-c9-username.c9.io:8080');

Edit: If you have issues with https you can try changing it to http like Ruben said.

Upvotes: 0

Ruben Daniels
Ruben Daniels

Reputation: 856

This might be caused by HTTPS usage in Cloud9. You can actually use HTTP to access your wordpress site. Simply copy the cloud9 application url to a new window and change https to http. That's it.

Upvotes: 1

infiniteloop
infiniteloop

Reputation: 885

I'm not familar with the environment in Cloud9 IDE. but did have a lot of wordpress migration experience.would like to share some debug ideas with you.

If u confirmed it's the .htaccess that caused your redirect loop issue, have you tried wordpress wp-admin->settings->permalink , save permalink as default type;

Cause the .htaccess file is auto generated or modified by permalink settings, if u save permalink in default option, which will clean all the apache url rewrite rule and leave a clean .htaccess to you.

if "default" permalink (?postid=xxxx) didn't cause redirect loop. you need then check whether apache mode rewrite mod is on.

if not (default permalink url also not working, then it's not .htaccess problem.

Upvotes: 1

Related Questions