I'm about to launch a site that has been on a testing server using an IP address. There are some places where we had to actually put the IP address instead of using a relative URL. Is there an easy way / best practices to modify the IP address so that it uses the domain name instead (e.g. change http://222.22.22.22/~site to http://www.site.com).

Comments

gbrands’s picture

Not sure if this is the best way, but you could just use MySQL to replace the desired string:

Example, just replace field_data_body & body value with the table and field you want to change:

// Replace the body field
// I included both the href and src attribute 
UPDATE `field_data_body` SET
  `body_value` = REPLACE(`body_value`,"src=\"http://222.22.22.22/~site","src=\"http://www.site.com"),
  `body_value` = REPLACE(`body_value`,"href=\"http://222.22.22.22/~site","href=\"http://www.site.com");

Hope this helps!