Reputation: 1242
I am working on my first OctoberCMS project and so far all seems to be working fine.
This is my local server url http://localhost/5p_front/ and say for example my live project url will be something like this http://www.example.com or can be like this http://www.example.com/5p_front
I have installed the plugin called Static Pages and i have created few pages as well using this plugin which works fine.
The thing is, i have also added few images in these static pages using the WYSIWYG editor which they are providing and when i click on Code View icon inside that editor, i can see the HTML code and in html img tag i can see something like this
<img src="/5p_front/storage/app/media/uploaded-files/intigrate-backup.png" />
As you can see a text 5p_front inside my image tag as an src
So i was just wondering, do i need to reupload all the images and update all of my static pages once i upload whole project to live ?
Upvotes: 1
Views: 1309
Reputation: 690
I am assuming you are deploying to a production server where the path is: https://[my_client_site.com]/
IMO you should NEVER use a dev environment with a URL structure like http://localhost.com/[my_amazing_new_website] unless your production box is going follow the same URL path. (See below on setting up a Local Dev box).
Your config files need to be set up correctly to reflect the path you are using, OctoberCMS will take care of the rest. (check the config folder)
If you are not planning on deploying the contents of your "5p_front" folder as a path, then make sure your asset path in config/cms.php is stipulated like this:
'media' => [
'disk' => 'local',
'folder' => 'media',
'path' => '/storage/app/media',
],
Then update your static pages :-( .
How to set up a local Web Dev environment
http://watch-learn.com/series/local-development-with-vagrant
How to create an OctoberCMS deployment workflow from Dev
The easy way to successfully deploy your OctoberCMS app is using GIT and a service like GitHub. Doing this will let you seamlessly move your production code and images from your Development environment to your Staging > Production environments, and lets your "Roll Back" if something is not working.
Check out this high-level guide to using GIT in your deployment workflow: http://guides.beanstalkapp.com/deployments/best-practices.html
One final note about OctoberCMS deployments using GIT
OctoberCMS requires it's storage folder tree to remain intact (with the exception of folders with crazy names, example: "6c")
To ensure those folders are part of your deployment add .gitinore file to each folder and spec what files you want to ignore (The cached folders and files).
Hope this helps you out in successfully moving your media and pages to your production server :-)
Upvotes: 2
Reputation: 1291
Depends on how you upload the whole project to live and what the final URL will be.
If you upload your storage folder as well as everything else (i.e. flat deployment, straight up FTP transfer of your project to your server), then you won't need to reupload the files.
For the second part, if your website is going to be based at http://example.com/5p_front/
(as in October will be serving from that directory), then your links will be fine. However, if you want to serve from the root domain (http://example.com/
), then you will need to replace all instances of /5p_front/
with /
in your automatically generated (i.e. RainLab.Pages static pages) pages.
Upvotes: 0