Jump to content

migration localhost to server


vistad

Recommended Posts

I developed a website on LAMP - and now it's time to migrate it to the server.

I followed your recommendations - exported the db, uploaded all local folders as is, edited global.inc.php, imported the db successfully.

As a result the index.php is there, but all other pages are Not Found on the server. What did I do wrong?

Maybe I should have installed it on the server - and then imported the db?

Now I'm reinstalling the cubecart on the server.

Link to comment
Share on other sites

The remote web server needs three things:
1. a URL Rewrite module enabled
2. A configuration directive that gives permission for .htaccess directives to override settings
3. An .htaccess file with directives to switch on the URL Rewrite module, and directives to rewrite URLs.

Otherwise, the web server will look for literal path/document.html names - CubeCart requires these to be rewritten to a specific format in order to find the item requested.

Link to comment
Share on other sites

You said: "Edit the /includes/global.inc.php file. Replace DB connection settings and remove local URL - CubeCart will figure out for itself where it is."
Where is local URL in /includes/global.inc.php?
My current global.inc.php looks like this - is it wrong?:

<?php
$glob['adminFile'] = 'admin_xxxxxx.php';
$glob['adminFolder'] = 'admin_xxxxxx';
$glob['cache'] = 'file';
$glob['dbdatabase'] = 'xxxxxxxx';
$glob['dbhost'] = 'mysql.xxxxxx.com';
$glob['dbpassword'] = 'xxxxxxxxxxxxx';
$glob['dbport'] = '';
$glob['dbprefix'] = 'xxxxx_';
$glob['dbsocket'] = '';
$glob['dbusername'] = 'xxxxxx';
$glob['installed'] = '1';
?>


1. a URL Rewrite module enabled <<<=== Enabled by default by my provider
2. A configuration directive that gives permission for .htaccess directives to override settings <<<=== required to enable mod_rewrite
3. An .htaccess file with directives to switch on the URL Rewrite module, and directives to rewrite URLs <<<=== I have a section:

### Rewrite rules for SEO functionality ###
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /website.com/   <<<=== Here I had local URL, I've replaced it.
  
  Still does not work.
  
  Could you please show me a good sample of a working .htaccess file? 
  Thank you

Link to comment
Share on other sites

I would say there was no local URL variable in global.inc.php while it was at your local LAMP stack. So, nothing to remove. The file looks good.

In CubeCart's file /classes/seo.class.php, in the private static function _checkModRewrite(), there is the code that CubeCart will write to an .htaccess file if one does not already exist. (Note: certain parts of this uses CubeCart variables, so pay attention.)

If you still get generic 404 responses from the web server (CubeCart will give a 404-specific page, and will be obvious it is from CubeCart, and not the generic response from the web server), one or more of the three conditions is still false. An .htaccess file properly processed by the web server should have executed the ErrorDocument directive, which tells the web server to send CubeCart's index.php page (and CubeCart will determine to send the page with 404 main content). So, again, if you get a generic 404 response, then the web server is not properly processing the .htaccess file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...