[SOLVED] Not all links working after moving to new server

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

[SOLVED] Not all links working after moving to new server

Post by RyanC »

Hi, I have transferred a complete CMSMS site from my personal server/hosting to my company's server and hosting (both godaddy). The home page comes up as expected but none of the other pages will come up. When I click a link for a new page, I get an internal server message.

Tech support at godaddy said I should enable error messages, and I have done that and there are several like this:

"HP Fatal error: Cannot redeclare class SearchItemCollection in /home/oldhost/public_html/site/modules/Search/action.dosearch.php on line 5"

Those are all pointing to my old server. When I log into my admin area, I am able to edit the pages but have no way to preview them because I get the internal server error.

Also, my admin login is keeping the user and password of the old site. In the config.php file, I changed that to new info but for some reason it's not pulling from that.

Any help on getting these other pages to show up would be greatly appreciated.
Last edited by RyanC on Fri Jan 13, 2012 5:15 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Not all links working after moving to new server

Post by Dr.CSS »

Take the install folder from the version you run and put it in the root of site and run install/install.php...

BUT AT STEP 5 DON'T CREATE TABLES OR INSTALL DEFAULT CONTENT this will fix any path issues you may have in config.php...
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

Thanks for the quick response,

I deleted the install folder after I set the site up originally. Should I drag a new install folder from a new cmsms download in there?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Not all links working after moving to new server

Post by Dr.CSS »

Yes, make sure it's from the same version of CMSMS...
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

Thanks, it's an older version.... one more question, when I'm installing this fresh version, do I use the same database information as the site I'm trying to fix? Would two installations of cmsms pointing to the same database cause any problems?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Not all links working after moving to new server

Post by Jo Morg »

RyanC wrote:Thanks, it's an older version.... one more question, when I'm installing this fresh version, do I use the same database information as the site I'm trying to fix? Would two installations of cmsms pointing to the same database cause any problems?
Dr.CSS wrote:Take the install folder from the version you run and put it in the root of site and run install/install.php...

BUT AT STEP 5 DON'T CREATE TABLES OR INSTALL DEFAULT CONTENT this will fix any path issues you may have in config.php...
Just follow the instructions... :)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

edit--ok almost done, thanks for all the help. This did work however my prettyurls are not working anymore. Is there a way to maintain the page names of the previous site I just imported? When I enter "mod_rewrite" in the config.php file it breaks the pages.

Also is it safe now for me to delete the install folder?

Thanks!
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Not all links working after moving to new server

Post by Jo Morg »

Well it shouldn't break the pages. Unless you changed the site from the root to a sub-folder or from a sub-folder to the root. If so, you probably may have to adjust the .htaccess settings. I have moved sites between servers and never had that issue.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

Hi, the site is a subfolder. But it was moved from a subfolder from my other site.

For some reason this process (reinstalling CMSMS but skipping step 5) changed my "mod-rewrite" in the config.php to "none". When it's set to none, the pages work, they are just not pretty urls anymore. When I re-enter "mod-rewrite" is when the pages break. And I know I have to have that mod-rewrite setting for pretty urls.

I don't know which htaccess file to change, where it is or what to change it to. I'm not familiar enough with php. The htaccess I have at the root of this site is the standard:


RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

I don't really know how to proceed at this point.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Not all links working after moving to new server

Post by Jo Morg »

On the root of your cmsms installation, on the htaccess file.
Just after the

Code: Select all

RewriteEngine On
directive
you should use:

Code: Select all

#Sub-dir e.g: /cmsms
RewriteBase /<YourSubDir>
I believe that should make it work.

More on this: look at: URL Filtering Using .htaccess.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

hi when you say YourSubDir, am I supposed to enter the http://www.mysite/myfolder?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Not all links working after moving to new server

Post by Jo Morg »

Just: /myfolder
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

Thanks, the subfolder is called newsite so this is the exact contents of my htaccess file:

RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

#Sub-dir e.g: /cmsms
RewriteBase /<newsite>

but I'm still getting the 500 internal server error.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Not all links working after moving to new server

Post by Jo Morg »

Code: Select all

RewriteEngine On
#Sub-dir e.g: /cmsms
RewriteBase /newsite
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
RyanC
Forum Members
Forum Members
Posts: 97
Joined: Fri Aug 05, 2011 9:02 pm

Re: Not all links working after moving to new server

Post by RyanC »

Awesome! Everything's working again.

Thanks much for your help, no way I would have figured that out.
Post Reply

Return to “CMSMS Core”