Page 1 of 1

Moving to new server, images links are still pointing to the old server?

Posted: Mon Nov 27, 2006 7:44 am
by icammy
Hi all,
I have a develop server and a publish server.
Let the IP= 192.168.8.12 and 192.168.8.13 for these two servers.
Once I have tested all my code in the develop server, I would like to move them to the publish server.
I followed the small HOWTO in http://wiki.cmsmadesimple.org/index.php ... New_Server.
It work well for the contents and internal links.
But I would like to ask, what about the images that I have added in the develop server?
They are still pointing to the IP:192.168.8.12 instead of 192.168.8.13.
I have enabled the Pretty URL.
Is that I can't use the relative path for the images and the links as I am using the Pretty URL?
Thanks in advance!! =]

Re: Moving to new server, images links are still pointing to the old server?

Posted: Mon Nov 27, 2006 4:13 pm
by TimothyFoo
You need to update your config.php file. Specifically the following entries:

Code: Select all

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = '/home/dir/public_html/uploads/images';
$config['image_uploads_url'] = 'http://yoursite.com/uploads/images'; 
You will also need to change any other entry that points to your staging server, to point to your live server.

Re: Moving to new server, images links are still pointing to the old server?

Posted: Tue Nov 28, 2006 1:39 am
by icammy
Thanks Timothy!! ;)

I have two more question to ask.
1.Is that I can only change the entrys that points to my staging server to point to live server one by one? Is there any faster way?

2.And as I am using Pretty URL and I would also like to use the relative path for the links and images,
so that I need not to change all the links when I publish my web.

But when I use Pretty URLs
the links for the images will be http://192.168.8.12/cms/about-us/upload ... s/logo.gif
insteads of http://192.168.8.12/cms/uploads/images/logo.gif
while /about-us/ is added by the system as I am using Pretty URLs.
It makes the pic can't be loaded.
I have already set the metadata showbase = ture

Could anybody give me some hints to solve this problem??
Thanks a lot!!

Re: Moving to new server, images links are still pointing to the old server?

Posted: Tue Nov 28, 2006 3:22 pm
by TimothyFoo
You're welcome.

1. Well, you could reinstall the CMS on the new server, but select the option for no tables to be created in the database (so your data doesn't get overwritten) That would create a new config.php for you, but I don't think it will really be any quicker. I use a source code editor called SciTe, from here: http://scintilla.org/ it has a good search and replace function. That might make it quicker.

2. Use relative links for your images, rather than actual paths... eg. instead of using

Code: Select all

<img src="192.168.8.12/cms/about-us/uploads/images/logo.gif" />
just use

Code: Select all

<img src="uploads/images/logo.gif" />

Re: Moving to new server, images links are still pointing to the old server?

Posted: Wed Nov 29, 2006 9:22 am
by icammy
Thank you so much, Timothy!!! :D

Thanks for your recommendation about the source code editor, SciTe! I will try it later!! =]

For the relative links issue, I have tried to change the links to
, but the images are unloaded.
I have check with the links of these images, and it is
http://192.168.8.12/cms/about-us/upload ... s/logo.gif
what I wish to be is actually http://192.168.8.12/cms/uploads/images/logo.gif
/about-us/ is added by Pretty URLs.
Is that I can only choose to use either Pretty URLs or relative paths?

Re: Moving to new server, images links are still pointing to the old server?

Posted: Wed Nov 29, 2006 9:24 am
by Dr.CSS
Do you have {metadata} tag in the of the template?...

Re: Moving to new server, images links are still pointing to the old server?

Posted: Wed Nov 29, 2006 5:19 pm
by TimothyFoo
No problem icammy, you're welcome.

Mark knows a lot more about CMSMS than me. He's probably on the right track with the metadata smarty tag.

Re: Moving to new server, images links are still pointing to the old server?

Posted: Wed Nov 29, 2006 10:33 pm
by Dr.CSS
The {metadata} Tag will usually add in the head so relative links will work...

If you don't get the base link in your then paste the call in the Global Metadata: in Site Admin ยป Global Settings...

NOTE it must be in html format as above

Re: Moving to new server, images links are still pointing to the old server?

Posted: Thu Nov 30, 2006 1:43 am
by icammy
Thank you so much!!!
Thanks Timothy and Mark!!!!!! ;)
It's work!!!!!!! Both of you are hero!!!! :P