Adding subdomains pointing to the existing directories in application or external site
I was surprised to know that that you cannot add a subdomain and point to your existing directories. even pointing to other domains.This features was there in cpanel from beginning and it is quite useful. Especially this features helps to server make the site much more faster in magento by making subdomains for stating content like media, js etc and configure in magento application. I had this setup in my earlier hosting making the site to load ~1 sec. I have moved the site to cloudways now it loads ~4 seconds
-
jam william commented
Votre site, CalculOvulation, est une ressource précieuse pour les femmes cherchant à mieux comprendre leur cycle et optimiser leurs chances de conception. Le guide est clair, bien structuré et offre des explications détaillées sur l’ovulation et les phases du cycle [https://calculovulationfr.fr/calendrier-de-grossesse/] menstruel. Les outils comme le suivi de la température basale et des tests d’ovulation sont bien mis en avant, rendant l’expérience accessible et rassurante. Continuez ce beau travail d’accompagnement !
-
Willam stock commented
"Looking for anniversary quotes? Just like adding subdomains pointing to existing directories keeps things organized, the right quotes help keep love and memories alive in a meaningful way."
-
Willam stock commented
Create DNS records for subdomains, then configure your server to point each one to the correct directory or external URL.
-
Malik Faisal Ijaz commented
Add subdomains by updating DNS settings and linking them to existing app directories or external URLs via your hosting panel.
-
Willam Abroy commented
Create DNS records for subdomains, then configure your web server to point them to the correct directories or external URLs.
-
colin manro commented
Using subdomains for static and media URLs in Magento 2 is a smart way to optimize performance. By pointing these deezerpermium[https://dezerpremiumapk.com] subdomains to the `pub/static` and `pub/media` folders, you can enable parallel downloads, speeding up page load times. For non-Magento sites, a similar setup can also help improve load times by separating resources. Cloudways offers a good workaround if additional vhosts aren't supported. It’s a simple yet effective technique that enhances the user experience.
-
Eric Menk commented
In magento 2, we can insert subdomain for static and media url and use cpanel to point the the subdomain to the pub/static and pub/media folder. visit https://dzpremiumapk.com/
-
Aravind
commented
This is something I'm encountering as an issue while migrating an old WordPress site that used a subdomain for all images. I think my only option currently is to move all images to some sub-directory of the main domain and then run a search and replace in the database.
-
Anonymous
commented
This would be useful for many non-magento sites as well.
-
AdminCloudways
(Admin, Cloudways)
commented
At the moment, support for additional vhost for the sub-domains or pointing to separate webroots is not available.
However a solution for your scenario would be to add 'Additonal domains' through Cloudways panel and instead using separate webroots, specifiy the static/media paths in URL with additonal domains in Magento Admin
For e.g if you have additional domains static.yourdomain.com and media.yourdomain.com for static and media paths respectively.
First you can add them as additional domains through Cloudways Panel, this would map the additional domains/sub-domain to your application
Then in Magento panel: stores -> configuration -> web -> Base URL or Base URL Secure (in case your setup is on HTTPs) for magento 2.X, set path in following manner
static.yourdomain.com/pub/static/ (for static)
media.yourdomain.com/pub/media/ (for media)Setting this way enables you to gain the performance, as having the additional domains/sub-domains will increase the number of parallel downloads that the browser can perform.
Hope that answer your question
To read how you can add additional domains/sub-domains please follow this KB: https://support.cloudways.com/what-is-the-difference-between-primary-domain-and-additional-domains/
Regards,
Cloudways Team -
Anonymous
commented
Please implement this.
In magento 2, we can insert subdomain for static and media url and use cpanel to point the the subdomain to the pub/static and pub/media folder.Now with cloudways, we cannot do that anymore.
-
Mark
commented
Agreed. This should be a thing.