[Solved] Interesting 404 problems after moving site

Need help upgrading your Joomla! website or converting to Joomla! 1.5?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Gatsu000
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Feb 19, 2008 7:25 pm

[Solved] Interesting 404 problems after moving site

Postby Gatsu000 » Thu Feb 11, 2010 4:40 pm

We have some interesting 404 problems that we are stumped on. We currently are moving all of our sites from various hosters into our own Linux box. We have moved 6 sites. Every single site has been moved over and is working just fine once we move it over. We are having problems with 1 site though.

we have a perfect file transition and we move the database over successfully. We get a 404 error on every page (including the landing) We have tried a few things to resolve this.

Disable SEF URL's (Does nothing)
Change templates (Does nothing)

The only difference this site has from all the others is that it is the main site on our servers that uses named based virtual hosting. So it is the primary VHost.

Does anyone have any suggestions?
Last edited by Gatsu000 on Sun Feb 14, 2010 10:33 am, edited 1 time in total.

User avatar
toivo
Joomla! Champion
Joomla! Champion
Posts: 7418
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: Interesting 404 problems after moving site

Postby toivo » Thu Feb 11, 2010 7:16 pm

Have you set the $live_site variable in configuration.php to the full URL of the Joomla site? It helps getting the default virtual host site to present the correct URL if domains that do not have a corresponding virtual host point to the site.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

User avatar
raghavtomar
Joomla! Guru
Joomla! Guru
Posts: 641
Joined: Sat Aug 22, 2009 7:35 am
Location: India
Contact:

Re: Interesting 404 problems after moving site

Postby raghavtomar » Fri Feb 12, 2010 5:56 pm

@Gatsu000: Yes, entering your site address (e.g. http://domain.com ) in $live_site variable solves such problems but my question here is to toivo...
@toivo: You seem to know about this concept. What does this variable do and how come changing its value makes the site work? (Its worked for everyone of my sites)
Raghav Tomar
Head To Joomla Section At - http://meetraghav.co.in
All Users are requested to mark solved problems as RESOLVED! Its really helpful for others!

User avatar
toivo
Joomla! Champion
Joomla! Champion
Posts: 7418
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: Interesting 404 problems after moving site

Postby toivo » Fri Feb 12, 2010 8:19 pm

You seem to know about this concept. What does this variable do and how come changing its value makes the site work?
It is a long story. I had a problem in a setup where several domains are pointing to the IP address of the server but only one domain is installed as a virtual host and therefore the other domains are assigned to the default virtual host.

A couple of times I noticed a different domain in the status bar while the home page was loading and managed to pinpoint the problem to a particular extension that had been installed recently. The code in that extension prompted me to look at the standard function JURI::base() (http://docs.joomla.org/JURI/base) in libraries/joomla/environment/uri.php. It sets a static variable to store the domain which it subsequently dishes out.

If the server has received an HTTP request for a domain different from the virtual host, my guess was that the domain from the static variable is presented in a subsequent request instead of the real domain. However, if $live_site is set in configuration.php, its value overrides the domain stored in the static variable in JURI::base().

It is an unlikely explanation but it fixed my problem. The reason for your problem may be different but using $live_site fixed it as well.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

Gatsu000
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Feb 19, 2008 7:25 pm

Re: Interesting 404 problems after moving site

Postby Gatsu000 » Sat Feb 13, 2010 1:09 am

Well it did and didn't fix our problem. We added the live site variable to our website and at that point instead of 404 errors we got just blank white pages on every other page.

We figured what the hell maybe we screwed up. We killed the installation and database to see if fresh would work. We installed a fresh copy and it is working just fine without the live site variable.

To recap:
So joomla can run perfectly without that live site variable
Fresh installations work perfectly
Migrated site shows 404 errors
adding the live site variable only produces blank pages instead


Anyone have some solutions?

User avatar
toivo
Joomla! Champion
Joomla! Champion
Posts: 7418
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: Interesting 404 problems after moving site

Postby toivo » Sat Feb 13, 2010 3:09 am

The error causing the blank page is recorded in the PHP error log, the location of which is in the php.ini file.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

User avatar
raghavtomar
Joomla! Guru
Joomla! Guru
Posts: 641
Joined: Sat Aug 22, 2009 7:35 am
Location: India
Contact:

Re: Interesting 404 problems after moving site

Postby raghavtomar » Sat Feb 13, 2010 5:12 am

@Gatsu000: Well...in that case, I think it is some sort of extension giving the problem. Try disabling all third party extensions on the migrated site. See if that cures the trouble. If it does, start enabling those extensions one by one. You will have the troublemaker in a net!
Raghav Tomar
Head To Joomla Section At - http://meetraghav.co.in
All Users are requested to mark solved problems as RESOLVED! Its really helpful for others!

User avatar
raghavtomar
Joomla! Guru
Joomla! Guru
Posts: 641
Joined: Sat Aug 22, 2009 7:35 am
Location: India
Contact:

Re: Interesting 404 problems after moving site

Postby raghavtomar » Sat Feb 13, 2010 5:14 am

@Toivo: Thanks a lot!
Raghav Tomar
Head To Joomla Section At - http://meetraghav.co.in
All Users are requested to mark solved problems as RESOLVED! Its really helpful for others!

Gatsu000
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Feb 19, 2008 7:25 pm

Re: Interesting 404 problems after moving site

Postby Gatsu000 » Sat Feb 13, 2010 3:06 pm

What does this mean?

[Sat Feb 13 08:03:49 2010] [error] [client (blanked)] PHP Fatal error: Cannot redeclare JConfig::$live_site in /path/to/site/public_html/configuration.php on line 21

User avatar
toivo
Joomla! Champion
Joomla! Champion
Posts: 7418
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: Interesting 404 problems after moving site

Postby toivo » Sat Feb 13, 2010 7:58 pm

You may have two lines starting with $live_site in the file configuration.php.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

Gatsu000
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Feb 19, 2008 7:25 pm

Re: Interesting 404 problems after moving site

Postby Gatsu000 » Sat Feb 13, 2010 9:25 pm

I see that got rid of the blank pages. Every time we load a page and get those mysterious 404 errors we get this log

[Sat Feb 13 14:09:49 2010] [error] [client 65.36.241.76] PHP Notice: Trying to get property of non-object in /pathtofiles/public_html/includes/router.php on line 179
[Sat Feb 13 14:09:49 2010] [error] [client 65.36.241.76] PHP Notice: Trying to get property of non-object in /pathtofiles/public_html/includes/router.php on line 182

What is this router thing? Someone might be able to let me know what that is (the live site is properly in place now btw)

Gatsu000
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Feb 19, 2008 7:25 pm

Re: Interesting 404 problems after moving site

Postby Gatsu000 » Sun Feb 14, 2010 10:32 am

Ok, we found our problem. While doing some digging we looked at the lines of code in our routing table

Code: Select all

         //Set the information in the request
         $vars = $item->query;

         //Get the itemid
         $vars['Itemid'] = $item->id;


SO we read the pages http://docs.joomla.org/Routing

After thinking for awhile. What would try to read the incorrect file hierarchy? We had changed everything in all the correct places. Well we realized we had caching set. We simply cleared the entire cache and it worked just fine. We were even able to remove the live site variable and it still worked.


Return to “Migrating and Upgrading to Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 4 guests