admin管理员组文章数量:1426058
I'm trying to optimize a site and the last thing I want to do is to serve static content with a subdomain that will be without cookies, and I have a problem with that.
I tried a couple of things to do and I will describe what I did and what problems I had.
I first added the DNS record to hosting for the subdomain, set as A record and the content is set to server IP. Then added a subdomain in the control panel of the domain provider, set to the Authoban option used to serve static content at high speed. Then added a subdomain via cPanel and set Document Root to "public_html/wp-content/uploads" and added the following code to the top of the wp-config.php file:
define("WP_CONTENT_URL", "");
After this, it was not possible to load the site and loading of WP admin panel was very slow and also it was not possible to load images inside the admin panel media tab.
The other thing I did was change the subdomain setting, on hosting and control panel of the domain provider, to the CNAME DNS record that points to main domain.
And after this change the loading of the site was very slow and only html was loaded, and there were errors about loading images and scripts from a static subdomain, in fact, it was not possible to access them.
Another important thing is that the site uses CloudFlare, but I do not currently have access data, I should soon have to get them.
So does anyone know where I'm wrong and how to do this right?
I'm trying to optimize a site and the last thing I want to do is to serve static content with a subdomain that will be without cookies, and I have a problem with that.
I tried a couple of things to do and I will describe what I did and what problems I had.
I first added the DNS record to hosting for the subdomain, set as A record and the content is set to server IP. Then added a subdomain in the control panel of the domain provider, set to the Authoban option used to serve static content at high speed. Then added a subdomain via cPanel and set Document Root to "public_html/wp-content/uploads" and added the following code to the top of the wp-config.php file:
define("WP_CONTENT_URL", "http://static.mysite");
After this, it was not possible to load the site and loading of WP admin panel was very slow and also it was not possible to load images inside the admin panel media tab.
The other thing I did was change the subdomain setting, on hosting and control panel of the domain provider, to the CNAME DNS record that points to main domain.
And after this change the loading of the site was very slow and only html was loaded, and there were errors about loading images and scripts from a static subdomain, in fact, it was not possible to access them.
Another important thing is that the site uses CloudFlare, but I do not currently have access data, I should soon have to get them.
So does anyone know where I'm wrong and how to do this right?
Share Improve this question asked May 23, 2019 at 12:39 comerssilacomerssila 11 Answer
Reset to default 0The Solution is in the Document root of your subdomain.
You must set it to "public_html/wp-content"
because it also loads your themes' files which are outside the uploads
directory
本文标签: customizationProblems with setting up a subdomain to serve images and scripts
版权声明:本文标题:customization - Problems with setting up a subdomain to serve images and scripts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745469557a2659688.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论