0

I have my first craft website all working great on my local dev server and want to move it to the production server. I think I went about this the wrong way but I installed a fresh install of craft on the pro server then purchased a pro license.key. This all installed OK. This is the same root level structure as the local dev version.

I made sure both sites were upto date then copied over my database dump from dev and uploaded my templates. However this has broken the URLs (the home page loads). Have I missed something?

The production server doesn't have the domain pointing at it but can be view via the IP like so.

http://79.170.40.48/mydomain.co.uk/ <-- though it does require the trailing lash

The odd bit is if I visit the link

http://79.170.40.48/mydomain.co.uk/products

the browser address bar says

http://79.170.40.48/mydomain.co.uk/products

the apache error says the requested URL is /home/sites/mydomain.co.uk/public_html/index.php was not found on this server.

And curiously the /home/sites/ address is what my my local dev path is. So where is the remote product install getting this from?

  • Have you checked your config file (craft/config/general.php)? It sounds like perhaps your siteURL and environmentVariables are set with your local dev settings. – Douglas McDonald Oct 17 '14 at 0:28
  • Thanks Douglas - but the general.php has no settings. As in empty. return array( ); – Taylermade Oct 17 '14 at 6:29
  • In your public_html, do you have your index.php file, and does it point to the correct location for craft? Where is the craft/ folder located? 1 level above public_html? Or did you change things around? If you open up your local index.php file, you will see $craftPath on line 4. Make sure that reflect to where Craft is located in your folder structure. – Fred Carlsen Oct 17 '14 at 8:20
  • Thanks Fred. My folder structure is as default only the public is named public_html. public_html is the web root and craft sits one level above. index.php in webfoot = `$craftPath = '../craft'; Also - this all works locally. – Taylermade Oct 17 '14 at 10:54
  • Checked craft.log? Tried turning on devMode? Is your .htaccess file in place? Are you able to access the control panel? – Fred Carlsen Oct 17 '14 at 15:51
1

Craft makes it easy to handle multiple environments, but you need to make it aware about the differences. Usually it's smart enough to enough to know the base folder path that you have it hosted in.

It's also smart enough to usually which url's you want. Sometimes it doesn't properly remove index.php from the URL, and that you can manually override with the setting omitScriptNameInUrls.

Since your public folder is named public_html, it's not clear from your question if you are running with the standard folder structure (index.php located in public folder, $craftPath inside index.php pointing to craft/ folder one level above public folder).

In general, you should have a look at the documentation regarding multi-environment configuration.

The one other area where it's usually necessary to set environment specific settings is Asset sources: Check out the chapter on that in the docs as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.