CodeIgniter Forums
Problems moving site to another domain - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Problems moving site to another domain (/thread-74272.html)

Pages: 1 2 3 4


Problems moving site to another domain - pantheonride - 09-04-2019

Hi,

I have a customised site based on codeigniter that is now hosted on my server with a domain (for example abc.net)
It is working fine but I like to move in to another domain hosted on the same server (for example abc.com)

I downloaded all the files on abc.com under public_html, modified $root to abc.com from abc.net in config.php and routes.php
and reupload them to abc.net under public_html. At the same time, I also downloaded the database files using mysql from abc.net and reuploaded them in a new database using mysql under abc.com taking care to user the same user names, user passwords and database names. As a final step, I modified made sure any instances of abc.net is changed to abc.com in the htacess files in each folder.

However, when the site loads in abc.com, it doesn't load at all. It doesn't even give any error. so abc.com shows a blank page with nothing in it. 
Any ideas on why is this happening?

I did not create the site myself even though I owned it as it was developed by a freelance web developer who has since abandoned the project. Any help is greatly appreciated.


RE: Problems moving site to another domain - php_rocs - 09-04-2019

@pantheonride,

What version of CI? Did you check the error logs?


RE: Problems moving site to another domain - InsiteFX - 09-04-2019

Did you view the CodeIgniter and server log files to see if there are any errors?

You may want to turn on error handling to check the web site for errors but make you
turn it back off when finished testing it.

error_reporting(E_ALL);
or
ini_set('error_reporting', E_ALL);


RE: Problems moving site to another domain - dave friend - 09-04-2019

If might have been easier to leave all the files etc. in place and simply change the Domain Name Server settings from abc.net to abc.com. The all you need to do is change $config['base_url'] and you would most likely be up and running. You would have to look closely for any hardcoded URLs to the full .net domain. (Which best practices would not have allowed.) Smile

Obviously, you would need to replace the SSL certificates for .net in the server with the ones for .com.

This approach assumes you don't care about the .net domain any more.

But otherwise, I cannot think of what else would need changing.


RE: Problems moving site to another domain - John_Betong - 09-04-2019

Try adding the following script to index.php and make sure the line number and filename are showing.

Once this is working, move the script down until the blank screen appears again.

Perhaps also temporarily rename .htaccess file.

<?php // index.php

echo __file__ . ' : ' .__line__ ; die;


RE: Problems moving site to another domain - pantheonride - 09-04-2019

(09-04-2019, 07:59 AM)InsiteFX Wrote: Did you view the CodeIgniter and server log files to see if there are any errors?

You may want to turn on error handling to check the web site for errors but make you
turn it back off when finished testing it.

error_reporting(E_ALL);
or
ini_set('error_reporting', E_ALL);

I tried doing that but no error messages were displayed. Same blank page.


RE: Problems moving site to another domain - pantheonride - 09-04-2019

(09-04-2019, 11:37 AM)dave friend Wrote: If might have been easier to leave all the files etc. in place and simply change the Domain Name Server settings from abc.net to abc.com. The all you need to do is change $config['base_url'] and you would most likely be up and running. You would have to look closely for any hardcoded URLs to the full .net domain. (Which best practices would not have allowed.) Smile

Obviously, you would need to replace the SSL certificates for .net in the server with the ones for .com.

This approach assumes you don't care about the .net domain any more.

But otherwise, I cannot think of what else would need changing.

To be honest, I am now just switching domains under same server because I am testing if I can move the site to a different domain as of now. In the longer term, I would like to move the whole site to a better server and also under a different domain. I have looked closely for any hardcoded urls and changed them and I would think its unlikely that I have missed out on any although as mentioned, I replaced the correct url in config.php, routes.php as well as the htaccess files. I am currently using free SSL certificates provided by the server and they would also have automatically replaced the cert when i created the new acount with new domain. I think the solution could be something simple like php version (mine is php 7.3 btw) although I am still not sure.


RE: Problems moving site to another domain - pantheonride - 09-04-2019

(09-04-2019, 05:39 PM)John_Betong Wrote: Try adding the following script to index.php and make sure the line number and filename are showing.

Once this is working, move the script down until the blank screen appears again.

Perhaps also temporarily rename .htaccess file.

<?php // index.php

echo __file__ . ' : ' .__line__ ; die;

I added the lines right at the top of index.php and the result is still a blank page. Makes me think that the problem could lie on something fundamental.


RE: Problems moving site to another domain - pantheonride - 09-04-2019

sorry i checked the php versionvfor abc.com and realised it was 5.5. i have since changed it to 7.1 via cpanel for abc.com so that it i same as abc.net. However, it did not seemed to have changed anything with the site still showing a blank page. So the problems does not lie with php version. Any more ideas what could be the problem?


RE: Problems moving site to another domain - John_Betong - 09-05-2019

(09-04-2019, 09:43 PM)pantheonride Wrote:
(09-04-2019, 05:39 PM)John_Betong Wrote: Try adding the following script to index.php and make sure the line number and filename are showing.

Once this is working, move the script down until the blank screen appears again.

Perhaps also temporarily rename .htaccess file.

<?php // index.php

echo __file__ . ' : ' .__line__ ; die;

I added the lines right at the top of index.php and the result is still a blank page. Makes me think that the problem could lie on something fundamental.
Try adding a very simple index.html file and see if that works. If it does not render than the site is not set correctly.

Did you try temporarily renaming the .htaccess file?