Page 1 of 2
[SOLVED] Not all links working after moving to new server
Posted: Fri Jan 13, 2012 12:28 am
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.
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 1:14 am
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...
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 1:24 am
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?
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 1:33 am
by Dr.CSS
Yes, make sure it's from the same version of CMSMS...
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 1:37 am
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?
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 2:03 am
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...

Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 3:57 am
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!
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 1:18 pm
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.
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 3:00 pm
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.
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 4:42 pm
by Jo Morg
On the root of your cmsms installation, on the htaccess file.
Just after the
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.
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 4:53 pm
by RyanC
hi when you say YourSubDir, am I supposed to enter the
http://www.mysite/myfolder?
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 4:55 pm
by Jo Morg
Just: /myfolder
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 4:57 pm
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.
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 5:01 pm
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]
Re: Not all links working after moving to new server
Posted: Fri Jan 13, 2012 5:15 pm
by RyanC
Awesome! Everything's working again.
Thanks much for your help, no way I would have figured that out.