Phase
March 24, 2015, 6:24am
1
Sponge is using a temporary (HTTP 302) redirect from http://www.spongepowered.org to http://spongepowered.org . It’s fine, but a permanent (HTTP 301) redirect is considered best practice.
After doing some testing, I found that 60% of pages on other websites link to http://www.spongepowered.org , which can potentially splitting up your search engine ranking.
4 Likes
Sure, it’s best practice. I’m not fully sure if, for instance, the Google crawler makes any distinction between 302 and 301: https://developers.google.com/webmasters/ajax-crawling/docs/faq?csw=1#redirects
Note that if you use a permanent (301) redirect, the url shown in our search results will typically be the target of the redirect, whereas if a temporary (302) redirect is used, we’ll typically show the #! url in search results.
301 is considered best practice for this point, exactly. For instance, my router.conf for nginx.
server {
listen 80;
server_name www.ferusgrim.me ferusgrim.me;
server_tokens off;
return 301 https://www.ferusgrim.me;
}
server {
listen 443 ssl;
server_name ferusgrim.me;
server_tokens off;
include /etc/nginx/conf.d/ssl/ssl.conf;
return 301 https://www.ferusgrim.me;
}
server {
listen 80;
server_name blog.ferusgrim.me;
server_tokens off;
return 301 https://www.ferusgrim.me;
}
server {
listen 443 ssl;
server_name blog.ferusgrim.me;
server_tokens off;
include /etc/nginx/conf.d/ssl/ssl.conf;
return 301 https://www.ferusgrim.me;
}
server {
listen 443 ssl;
server_name url.ferusgrim.me;
server_tokens off;
return 301 http://url.ferusgrim.me;
}
server {
listen 80;
server_name repo.ferusgrim.me;
server_tokens off;
return 301 https://repo.ferusgrim.me;
}
server {
listen 80;
server_name ci.ferusgrim.me;
server_tokens off;
return 301 https://ci.ferusgrim.me;
}
server {
listen 80;
server_name mail.ferusgrim.me;
server_tokens off;
return 301 https://mail.ferusgrim.me;
}
server {
listen 80;
server_name znc.ferusgrim.me;
server_tokens off;
return 301 https://znc.ferusgrim.me;
}
server {
listen 80;
server_name git.ferusgrim.me;
server_tokens off;
return 301 https://git.ferusgrim.me;
}
server {
listen 80;
server_name dev.ferusgrim.me;
server_tokens off;
return 301 https://git.ferusgrim.me;
}
server {
listen 443;
server_name dev.ferusgrim.me;
server_tokens off;
return 301 https://git.ferusgrim.me;
}
Moved to “Sponge Web” since this is not discussion about the forum itself but the website.
1 Like
Wait, you can have 2 server names in a server block, Cools, I never knew you can put shared configuration in another file, I’ll note that for later use.
1 Like
lukegb
March 29, 2015, 7:39pm
7
Sorry I haven’t done anything about this yet.
We don’t actually redirect from http://www.spongepowered.org to http://spongepowered.org - if you attempt to connect to the HTTP version of the site, you will be redirected to the HTTPS version (using, at the moment, 302 Found). At present, both https://spongepowered.org and https://www.spongepowered.org will work, and both return the same content (i.e. there is presently no canonical version of the site).
My plan is to make https://www.spongepowered.org the canonical version and make the http and non-www variants redirect using an HTTP 301, as suggested by the OP, to that version,
2 Likes