404 error on upgrading from 1.7.8 to 1.8.8

I tried upgrading my site to latest Elgg version but 404 error

in place of indx page, A activity page is called. and results in 404 error. 

I tried it many times with fresh installation also. but same error,

tried over writing .htaccess didn't worked. 

On searching, i got this


when i place pg in url

domain.com/activity gives 404 error

but if i add domain.com/pg/activity     non-formatted, but works

same with admin link, it works on adding pg in link

It seems like issue with Elgg instllations in subdirectory.

Please tell, any solution to problem.

  • Hello,

    This could be an upgrade gone wrong. Which steps did you follow to do the upgrade?

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • I follwed community wiki 

    Also i tested it many times, with fresh copy also, but same error


  • Are there messages in the Apache error log?

  • Steve can you please tell, how to check Apache error log.

  • @adoi it is server dependent. Check in the admin area under statistics -> server info. In some cases we are able to figure it out. Otherwise, you'll need to use Google.

    Edit - I see that you haven't installed it yet. You'll need to Google for the location based your hosting provider/server OS

  • What do you mean by "fresh copy"? Do you mean that you get the 404 error on a fresh installation with no 3rd party plugins and fresh database? If yes, then I would say that it's a server config issue.

    On the other hand, if the error happens when upgrading your 1.7 site to Elgg 1.8 I would rather suspect an incompatible 3rd party plugin. Disable all 3rd party plugins before you start with the update. Only after the update is finished and you don't see any 404 errors start to enable them again. If the error appears again you might be able to narrow down the problematic plugin.

    You also need to consider that upgrading from Elgg 1.7 to Elgg 1.8 works slightly different than upgrading withing Elgg 1.7 from one minor new release to the next (and again upgrading within Elgg 1.8). The step from Elgg 1.7 to Elgg 1.8 makes it necessary to remove the old views folder and some others to get rid of obsolete old views (which could indeed causes trouble like 404 errors). The directories to be removed are listed in UPGRADE.TXT. I would suggest to even remove ALL core files and core plugins from your Elgg root folder - only keep settings.php in the engine folder and all 3rd party plugins folders in mod. All other files and folders can be removed and after that replaced by the new Elgg 1.8 files. Then you will know for sure that no obsolete files remain.

  • Hello Iionly, Yes. I tested it with fresh installation with no plugin enabled ( plugin enabled by default on first admin login after installation) 

    Therewere no 3rd party plugin. 

    Also for ensuring that i had followed instructions right. i tried it 2 more times, but always i got same error. 

    On searhing for solution, I founf a ticket in Trac, which shown that it happened with some else too, and it unresolved issue. 

    I try it one more time, time delete mod directory also. 

    But i think, there is need to check if it is Elgg related. as after upgrade, 

    It looks for activity page, and gives 404 error, but on adding "pg" it follows the link. but unformatted. 

    I am able to access all areas in CMS by adding "pg", but all links follows their normal path and results in 404 error.

    On adding pg i got access in admin area also.  

  • The "pg" was part of Elgg 1.7 urls used by Elgg's pagehandler mechanism. In Elgg 1.8 the "pg" is no longer part of the url. Though I don't know why this should have any influence on a fresh Elgg 1.8 only installation.

    When you install in a subdirectory have you set RewriteBase in .htaccess accordingly? This is the only thing I can think of at the moment for the fresh Elgg 1.8 installation.

  • Iionly, 

    I think you caught the problem. 

     I found this in my .htaccess file

    RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/pagehandler.php?handler=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/pagehandler.php?handler=$1&%{QUERY_STRING}


    I deleted this part "pg\"

    But still no sucess. Please tell, how to set rewritebase

  • No! Please, don't delete the "pg" part in the .htaccess file. These rewrite rules will ensure that for example old bookmarks to site content will still work. Elgg will handle this for you. It's only in the plugins code where "pg" should no longer be used in pagehandlers.

    So, it's best to start by copying/renaming htaccess_dist again to .htaccess. Then look into the .htacess file. There you will find some lines with "RewriteBase". These are commented out by default. If you have installed Elgg into a subdirectory of your www document root folder on your server (for example in a subdirectory called "elgg") and then call your site with http://domain.url/elgg, you would add a line to the .htaccess file that looks like

    RewriteBase /elgg/

    You need to modify it according to your subdirectory name. Just make sure you add a "/" at the end. And don't include the full url or the path to the directory on your server but only the relative part starting from your document root folder (i.e. what follows after your domain name in the url).