S
S
Sergey2012-10-23 14:18:18
Nginx
Sergey, 2012-10-23 14:18:18

Transferring statics to a subdomain for a running project

It is necessary to translate the project statics (css/js/images) to the cdn.<site_domain>.com subdomain using nginx. From a logical point of view, everything seems simple to me:
1. I create a subdomain in the config
2. I change the address of statics on the site
The problem is that I can not take into account all the places with the output of statics, so I would like to play it safe.
Question: is it religiously correct from the point of view of SEO to make a 301 redirect in nginx for static? Those. I now have a standard location for statics, so I will put a redirect to cdn.<site_domain>.com there. And is it necessary to immediately kill the processing of statics on the main domain (won't this be considered a duplicate)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pr0tect0r, 2012-10-23
@pr0tect0r

And is it necessary to immediately kill the processing of statics on the main domain (won't this be considered a duplicate)?

1. you definitely don’t need to clean it right away, because. Users have local caches, they have saved search engine pages. But on the other hand, the transitions from these pages are negligible and these users can hardly be called targeted.
Look at the access logs for the declining number of hits to the old static to estimate the time it takes to completely remove it from the main domain.
2. The transfer of static images will not affect the SEO in any way (unless, of course, you are not a photo hosting), JS and CSS will not be considered duplicates either)
3. if you have already decided to transfer static images to a separate domain, it is recommended that this be a different .domain - domain.com, domain for static cdn.domain-ltd.com). This is also to reduce the load on the statics server with all sorts of cookies, etc. from the main domain.
4. try to use as few redirects as possible, browsers and search engines are not very fond of them - it's easier for the browser not to load an image than to process 3xx headers.

D
Daniel Newman, 2012-10-23
@danielnewman

You need something like a conditional redirect, if file exist? Did I understand you correctly? I don't understand what duplicates you are talking about. Duplicate pictures? Why does the option with nfs and mounting folders to the old location not suit you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question