Need to change the path to the project after moving it

Permalink 1 user found helpful
I moved the project to another server and all appears to be working except for a few loose ends:

*** The project expects to be in base directory rather than in a sub-directory. How do I change that?

Example: The images are not here

http://www.toddcary.com/files/9713/6605/7737/the-rotary-club-of-ben...

They are here

http://www.toddcary.com/greaterbendrotary/files/9713/6605/7737/the-...

*** I cannot log in to the project. Where is that changed?

I greatly appreciate the help as I get familiar with C5.

Todd

rtcary
View Replies: View Best Answer
landollweb replied on at Permalink Best Answer Reply
landollweb
Edit <doc_root>/<concrete5_folder>/config/site.php.

Make sure your directory definitions reflect the new location. I believe the following is correct, based on the url's you provided:

define('BASE_URL', 'http://www.toddcary.com/greaterbendrotary');
rtcary replied on at Permalink Reply
rtcary
I am missing something on how the BASE_URL is used in C5.

In site.php, I set BASE_URL as follows:

define('BASE_URL', 'http://www.toddcary.com/greaterbendrotary');

In base.php, I check the value and it is correct:

if (!defined('BASE_URL')) {
if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
define('BASE_URL', 'https://' . $_SERVER['HTTP_HOST']);
} else {
define('BASE_URL', 'http://' . $_SERVER['HTTP_HOST']);
}
}
//echo "BASE_URL: " . BASE_URL; exit;

However when I run the project I get this in the URL:

http://www.toddcary.com/greaterbendrotary/greaterbendrotary/...

with this error message:

The requested URL /greaterbendrotary/greaterbendrotary/ was not found on this server.

I am missing some basic php here.

Thanks for the help...

Todd
rtcary replied on at Permalink Reply
rtcary
If I set DIR_REL to

define('DIR_REL', 'greaterbendrotary');

The URL is correct:

http://www.toddcary.com/greaterbendrotary/...

However that dir is not part of where C5 is looking for images, etc.

http://www.toddcary.com/files/9713/6605/7737/the-rotary-club-of-ben...
landollweb replied on at Permalink Reply
landollweb
I'm looking again at it now...
landollweb replied on at Permalink Reply
landollweb
What you did the directory settings in site.php is actually correct. (For some reason, I was thinking the "greaterbendrotary" directory was your hosting document root, but now I realize that is the sub-directory where you placed C5.)

About the images... let's start with one, "president.png" in the sidebar. (I skipped past the images that are loaded in as part of the theme for now.) I can't really see your editing environment... what method did you use to insert the images there? In other words, is that a regular content block, an html block, or something custom?

I did noticed that the html references
src="/files/6613/6613/2630/president.png"

When I append that relative path onto "http://www.toddcary.com/greaterbendrotary", I see the image. So it looks like you're really close.

Where were you seeing the reference tohttp://www.toddcary.com/files/...?...
rtcary replied on at Permalink Reply 1 Attachment
rtcary
Here are the values in ./config/site.php

define('BASE_URL', 'http://www.toddcary.com');
define('DIR_REL', '/greaterbendrotary');

The server file structure is attached.

I did not add the images; they were added by another developer on the actual site (under development):http://www.greaterbendrotary.com. My experience is with PHP, but no CMS, so I am moving a copy to my site so I can learn about C5 since the other developer is a graphic artist with HTML knowledge but no PHP.

Todd
landollweb replied on at Permalink Reply
landollweb
Okay, I see what the problem is. If these are images that were inserted into a regular content block, when an image is inserted, the relative path is included in the insertion. That relative path includes DIR_REL at the time of insertion, but it does not get updated automatically if the BASE_URL and DIR_REL change.

So you'll just have to edit those blocks, put the content block editor in html mode (there's a "html" tool in the toolbar), and insert "greaterbendrotary/" in front of the file paths shown in your img tags. (I am presuming those are all regular content blocks. If not, I'd need to know more about what kind of blocks they are.)
rtcary replied on at Permalink Reply
rtcary
That makes sense!

Where are the users and passwords stored? I assume in one of the MySQL tables. When I moved the project over, my usual PW does not work.

MANY THANKS for the guidance...

Todd
landollweb replied on at Permalink Reply
landollweb
Also, just wondering... could the old image paths have been cached? If so, that could explain it. Try clearing your site cache.
rtcary replied on at Permalink Reply
rtcary
I cleared the cache, however no change.

Note: I am not getting notifications when replies are made to this thread.
rtcary replied on at Permalink Reply
rtcary
Correction: I did get in with my old User name and PW.