trying to implement a new DNS-url/link addresses won't change...

22 posts by 2 authors in: Forums > CMS Builder
Last Post: April 17, 2008   (RSS)

By rcrofoot - April 14, 2008

Hi Dave-

We just changed the DNS to the site I've been working on...I changed all urls/links to the new ones...except I noticed the code from CMS Builder still contains the old address...

I think this may be the offending code...specifically $record['_link'] and $upload['urlPath']...do I need to change an address in CMS to fully implement this change...Sorry, I'm lost on this one:

<td width="255px">
<a target="_parent" href="<?php echo $record['_link'] ?>">
<!--load this variable in order to test for no main photo-->
<?php $uploadList = getUploads($options['tableName'], 'main_photo', $record['num']); ?>
<?php if (empty($uploadList)): ?>
<img src="images/nophoto.jpg" width="255" height="170" border="0" /><br/>
<?php endif ?>
<?php foreach (getUploads($options['tableName'], 'main_photo', $record['num']) as $upload): ?>
<?php if ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="255" height="170" border="0" /><br/>
<?php endif ?>
<?php endforeach ?>
</a>
</td>

Thanks, Rick

Re: [rcrofoot] trying to implement a new DNS-url/link addresses won't change...

By Dave - April 14, 2008

Have the relative directory path from your website root changed?

Unless you've checked "[_] Save full URL for local links" under Admin > General it shouldn't have the http domain part of the url.

Let me know what it's outputting in the source code and what you'd like it to output (or post an url if you can) and we'll see what can do to get it working again quick for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] trying to implement a new DNS-url/link addresses won't change...

By rcrofoot - April 14, 2008

Dave-

I'm not sure what question to ask...

The DNS used to be [url "http://www482.pair.com/decaro/kellyassociates/"]http://www482.pair.com/decaro/kellyassociates/[/#800080][/url] and this line of code worked as expected: <a target="_parent" href="[/#ff0000][url "http://www.kellyrealestate.com/<?php"]<?php[/#ff0000][/url] echo $record['_link'] ?>"[/#ff0000]>

The DNS was changed to [url "http://www.kellyassociates.com"]http://www.kellyassociates.com[/#800080][/url] and now I have to use an absolute address: <a target="_parent" href="[/#ff0000][url "http://www.kellyrealestate.com/<?php"]http://www.kellyrealestate.com/<?php[/#ff0000][/url] echo $record['_link'] ?>"[/#ff0000]>

This line seems to work ok without an absolute address: <img src="<?php echo $upload['urlPath'] ?>" width="255" height="170" border="0" />

My questions: Where do '_link' and 'urlPath' come from? Are they PHP server variables...I'm now wondering if I have to change to the new DNS in the PHP config file...

Please let me know if you need access to anything, and I'll send the info to dave@interactivetools.com...

Thanks, Rick

Re: [rcrofoot] trying to implement a new DNS-url/link addresses won't change...

By Dave - April 15, 2008

It's probably the filepath, not the DNS. So if you used to have your images in say /decaro/kellyassociates/images/ it's coming to look for them there on the new domain:

http://www.kellyassociates.com/decaro/kellyassociates/images/

You can confirm that by right-clicking on a broken image on the new site and selecting properties to see the url the image is trying to load from.

The quick fix would be to just upload your images to that same folder on the new site /decaro/kellyassociates/images/

If that doesn't work (or isn't appropriate) feel free to email me details and we can work on another solution.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] trying to implement a new DNS-url/link addresses won't change...

By rcrofoot - April 15, 2008

Hi Dave-

I don't know why I'm so confused by this...

So, what you're saying is, determine the address through the properties window of a broken image, and move the images there...Then I would have to change the upload directory in CMS to that directory...Correct?

Rick

Re: [rcrofoot] trying to implement a new DNS-url/link addresses won't change...

By Dave - April 15, 2008

You would have to change the upload directory, but it might make the most sense to do that and have all the uploads together.

So previously if all the files were uploaded to /decaro/kellyassociates/images/ then that's the path that is stored in the database for those uploads. It doesn't store the domain name by default because you might change domains. So since you moved domains it's still looking for the images in /decaro/kellyassociates/images/ but they're not there on this new domain.

Hope that makes sense.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] trying to implement a new DNS-url/link addresses won't change...

By rcrofoot - April 15, 2008

Dave-

My appologies in belaboring this, but my knowledge regarding domains is next to nothing...Before I make any changes, maybe your response to this will help me understand a bit more of what's going on...

The original site my employer set up was (is) located at: /usr/www/users/decaro/kellyassociates[/#ff0000]

That's where I upload all my program files...It contains "images", "css", "inc" folders, etc...It is the website root...

The URL I used to view finished web pages was: [url "http://www482.pair.com/decaro/kellyassociates/"]http://www482.pair.com/decaro/kellyassociates/[/#ff0000][/url]

A few days ago he told me he had changed the DNS to [url "http://www.kellyassociates.com/"]http://www.kellyassociates.com[/#ff0000][/url], and that any absolute addresses in my code should be changed to this new address.

(By the way the photos uploaded by CMS Builder are located at: /usr/www/users/decaro/cmsAdmin/uploads)[/#ff0000]

I think my mental dilema is that everything is still in its original place...The only thing that's changed is that there's been an additional "pointer" ([url "http://www.kellyassociates.com/"]http://www.kellyassociates.com[/#ff0000][/url]) created which point to the same place: [url "http://www482.pair.com/decaro/kellyassociates/"]http://www482.pair.com/decaro/kellyassociates/[/#ff0000][/url]

Maybe I have to stop analyzing so much and just try your suggestion...

Thanks, Rick

Re: [rcrofoot] trying to implement a new DNS-url/link addresses won't change...

By Dave - April 15, 2008

Hi Rick,

What's happening is it's still looking in the old path /decaro/cmsAdmin/uploads/ but since the domain has changed it's now looking here: http://www.kellyassociates.com/decaro/cmsAdmin/uploads/
instead of here: http://www482.pair.com/decaro/cmsAdmin/uploads/

Just imagine you have an image tag like this: <img src="/decaro/cmsAdmin/uploads/image.jpg">.

If you can easily copy the uploads folder from
/usr/www/users/decaro/cmsAdmin/uploads to
/usr/www/users/decaro/kellyassociates/decaro/cmsAdmin/uploads/
that might be a quick fix because then the same path will exist on both sites.

The other option would be to modify the upload paths in the database. You could do that with a program like PHPMyAdmin.

Hope that helps! Sorry it's so confusing!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] trying to implement a new DNS-url/link addresses won't change...

By rcrofoot - April 15, 2008

Hi Dave-

But to my understanding, http://www.kellyassociates.com and http://www482.pair.com/decaro/kellyassociates/ both point to the same physical location on the server...nothing on the server's been changed or moved...Both URLs translate to the same IP address...

Maybe there are two "/decaro" 's in the address, because in the uploads table the "urlPath" field contains data such as "/decaro/cmsAdmin/uploads/IMG_2108.jpg" and the address "http://www.kellyassociates.com" really points to "/usr/www/users/decaro/kellyassociates"...Now that I think about it more, I'd have to back out 1 directory to have "cmsAdmin/uploads" available...i.e. it's not available from "/usr/www/users/decaro/kellyassociates", but it is from "/usr/www/users/decaro"...If this seems correct logic to you, do you think it would be possible to create a "/decaro" directory within "http://www.kellyassociates.com", and create within that new directory, the existing structure and contents of cmsAdmin/uploads???

Thanks again, Rick







Hi Rick,

What's happening is it's still looking in the old path /decaro/cmsAdmin/uploads/ but since the domain has changed it's now looking here: http://www.kellyassociates.com/decaro/cmsAdmin/uploads/
instead of here: http://www482.pair.com/decaro/cmsAdmin/uploads/

Just imagine you have an image tag like this: <img src="/decaro/cmsAdmin/uploads/image.jpg">.

If you can easily copy the uploads folder from
/usr/www/users/decaro/cmsAdmin/uploads to
/usr/www/users/decaro/kellyassociates/decaro/cmsAdmin/uploads/
that might be a quick fix because then the same path will exist on both sites.

The other option would be to modify the upload paths in the database. You could do that with a program like PHPMyAdmin.

Hope that helps! Sorry it's so confusing!

Re: [rcrofoot] trying to implement a new DNS-url/link addresses won't change...

By Dave - April 15, 2008

Hi Rick,

If this seems correct logic to you, do you think it would be possible to create a "/decaro" directory within "http://www.kellyassociates.com", and create within that new directory, the existing structure and contents of cmsAdmin/uploads???


Yes, I think that's worth a shot. Try copying the contents of:
/usr/www/users/decaro/cmsAdmin/uploads to
/usr/www/users/decaro/kellyassociates/decaro/cmsAdmin/uploads/

And let me know if that fixes it.
Dave Edis - Senior Developer
interactivetools.com