customization - Problems with setting up a subdomain to serve images and scripts

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

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 1
Add a comment  | 

1 Answer 1

Reset to default 0

The 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745469558a4629072.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信