Magento 2 change static content folder - magento

Is it possible to rename static content folder? f.e from ../pub/static to /pub/statix
I saw 'base url for static view files' setting in the admin panel, but if I set it to {{secure_base_url}}/statix/ and re-deploy it, magento won't create that folder and I'll receive pages without css etc. URL will point to the statix, but there won't be that directory
Or maybe I could deploy that content to statix folder to make the urls work?

You cannot change the paths of static directories. It is an absolute path and will automatically generate every time you redeploy the site.

Related

How to run Multiple codeigniter application in single shared hosting server?

I am using shared hosing for Codeigniter application for deployment.
How can i run staging url on live server?
1) domain.com (Working)
2) domain.com/staging/ (Not working, showing 404 error)
I created staging folder under public_html directory, now put All CI code in staging folder, and tried to run the application with URL domain.com/staging/ but it redirect on domain.com/404
I expect to run domain.com for users and domain.com/staging for development. (Staging URL i will use for development and after that i will place the same code for live URL.)
This is most easily done by using a subdomain for the staging version, i.e. staging.doman.com. The folder where you put the CI files isn't super important as the subdomain will be set to use the directory you choose.
You will either need to have complete control over the server or have a service provider that allows you to set up subdomains.
- Expanded Answer -
If you cannot set up a subdomain then your next best option is to use the advice in the documentation on Managing you Applications. It isn't required to use the file structure shown there. In your case try the following.
Create a folder on the same level as application named staging.
Into that folder copy all the folders and files normally found in /application.
Add all application folders and files required by your site. The files in these folders are those that make up the application you are staging.
Make a copy of index.php (the file at the root of the public folder, i.e. domain.com/index.php) and name it staging.php. Both index.php and staging.php will be in the same folder.
Edit staging.php and change the value of $application_folder to be the absolute path to the staging folder. For example:
$application_folder = '/path/to/domain.com/public_folder/staging';
The path above is an example. You must replace it with the actual path in your server. If you have no idea what the full and absolute path is you can use
$application_folder = dirname(__FILE__).'/staging';
Browse to the URL domain.com/staging.php and you should get your default controller's output. To test that you are actually seeing the staging version of the page temporarily change something in the view file so there can be no doubt.
You will go to other controllers by using the URL domain.com/staging.php/other_controller.
Change the value of $config['index_page'] in /staging/config/config.php to staging.php, e.g.
$config['index_page'] = 'staging.php';
Without the above change redirect() and many other "helper" functions will not work correctly.
(Optional?) You can probably edit the main .htaccess and add rewrite rules for staging.php the same way it is done for index.php. But I will leave that as an exercise for you. (Or for another SO question.)
A final word. It might be necessary to make other configuration changes to accommodate the revised file structure. I tested the answer here but did not go beyond the most basic task of browsing to controllers. Most likely config values for sessions, cookies, and many others will need to be adjusted for the staged version to work correctly. Check out the documentation on Handling Multiple Environments for guidance on making this less painful.

transferring joomla from subdomain to main domain

i have my my website like abc.com/dev now i want to transfer it to abc.com,
what minimal changes should i do to make it work .
My website is in joomla is there way that i just move folder to main folder and add db setting.
Please guide i am new to joomla
Just Drag and drop your folders from your subdomain folder to root folder through FTP.
Then only changes you need to do is in your 'configuration.php' file located at the root folder. If your DB is not changed then do not change any of its setting. Just change the path of 'LOGS and TMP' folders in config file to the root path that are :
$log_path, $tmp_path
And I hope your site will work perfectly as it was working before.

Magento Multiwebsite Configuration Setup

I am using multi website magento store having 3 websites for books,electronics and apparels in subdirectories like www.example.com/books, www.example.com/apparels. Is it necessary to include all folders like app, downloader, skin, etc in root folder to subdirectories or any other option is there because it seems to consume more memory for each one.
I manage one Magento site with two stores (two totally different URLs) operating from one instance of Magento. Each URL points to a different base directory on the hosting site. One directory holds the entire Magento installation. The second directory uses a combination of symbolic links and actual files as follows.
Symbolic links: app, errors, includes, js, media, skin, var
Actual files: .htaccess, index.php
www-root/directory1/[all magento files]
www-root/directory2/[symbolic links and .htaccess and index.php files]
You then set the insecure and secure base URLs for each store. In this case there is a separate root category for each store. And many of the Magento configuration parameters may be set individually for each store or use the default value.
No, you don't have to.
You can create multiple stores from system -> Manage Stores -> Create Store, if you don't have them already.
You can manage the url of the stores from system -> configuration -> Web and set secure and unsecure base url for each store by selecting the configuration scope on the top left.
E.g.: You can select the scope to 'books' store and set base url to www.example.com/books and set the scope to 'apparels' store and set base url to www.example.com/apparels.
Edit:
You also have to copy the index.php to the subfolder and edit this file. E.g. for www.example.com/apparels, add:
$mageRunCode = 'apparels';
$mageRunType = 'website';
before the line:
Mage::run($mageRunCode, $mageRunType);
Also try to copy the .htaccess to the subdirectory.
No, you no need to copy all folder , you need to create folder for books & apparels then copy your index.php and .htaccess file from magento root folder to existing folder (both books & apparels) also you need to set base url in magento adminpanel > system > configuration > web for new stores

How to use symlinks in magento?

How to use symlinks in magento?
This is the scenario:
I have a subdomain store.example.com (say), it has 4 websites (de,fr,au,af).
I want each of these websites to link to store.de.example.com , store.fr.example.com, store.au.example.com and store.af.example.com respectively.
So that I can run each of these magento websites individually.
My usual approach for setting up Magento multisite environment.
Here are few additional goals that I’d like to achieve when doing this: core code out of the way , clean public folders, packed for easier deployment and testing.
magento_base/
htdocs/
htdocs/website_01/
htdocs/website_01/index.php
htdocs/website_01/.htaccess <-- symlink
htdocs/website_01/js/ <--symlink
htdocs/website_01/skin/ <--symlink
htdocs/website_01/media/ <--symlink
htdocs/website_01/errors/ <--symlink
htdocs/website_01/downloader/ <--symlink
htdocs/website_02/
Set up your magento isntallation to magento_base folder and right next to it (or any place you need or your virtual-host makes them) you’d make a folder for each of your subdomain, website (dependent of your multisite goals). Next we symlink public parts of magento to this folder and make a copy of index.php and change path for including Mage.php and set your website or store code at the end of it.
*note that if you have few sites then you can make htdocs folder inside your magento_base for easier deployment and map your domains inside that folder*
Next step is to point your domain, subdomain and map it to right website folder and you are good to go:
You get your codebase out of the public folder by pointing domains to public folder and symlinking Magento’s few public needs
Upgrades won’t mess with your symlinked files and you don’t have to change server configuration files
If you use git then you can have those symlinks pointed to stage, live branch checkouts and just push your changes to production or stage env’s
You can test inside magento base folder on your test-server without conflicting your production settings and setup different sites (sites can be accessed by site or store code)
client is pointed to public folder to upload his other stuff , campaigns, blogs whatever and that won’t be mixing with magento_base folder and you can make rules to include/exclude from your deployment procedure. No more crap inside.

Error when duplicating Joomla setup

I have a Joomla installation set up on my local server. I have duplicated with a new name the top-level Joomla folder so that all the information I have already put into the database can be edited slightly, whilst still keeping the original intact.
I have copied the database files over to a new database and made the relevant changes in Joomla admin. I've opened up configuration.php and changed all the file paths to the new one.
However, now I'm getting a server error when trying to access the web page and admin area. Are there any other files I need to edit with the new path to enable it to work under the new parent folder?
You shouldn't have to edit any files with any paths to make it work other than the tmp and log folders and the root folder line in htaccess if you have SEF URLs turned on. Turn off SEF URLs and see if the site starts working, if it does, then you need to edit htaccess. Since your admin is not working, my guess is that you messed up your configuration.php. Copy over the original unedited version to the copy site, it should work. You can then adjust the tmp and log paths within the admin in the global configuration.

Resources