On my domain there was some old subdomains like blog.domain.com etc
These aren’t used anymore but have links and traffic. So I want to 301 redirect them to my homepage which is www.domain.com
So how would I do that? Thanks
On my domain there was some old subdomains like blog.domain.com etc
These aren’t used anymore but have links and traffic. So I want to 301 redirect them to my homepage which is www.domain.com
So how would I do that? Thanks
First you create an HTML site:
ee site create sub.domain.com --html
That’s just because we won’t need any script or database capabilities. It’s “cheaper” to host an HTML site.
Now you edit your vhost (you should know how to use VIM):
ee site edit sub.domain.com
There is a location
block containing:
location / {
try_files $uri $uri/ =404;
}
Just replace the try_files
line with:
return 301 http://www.domain.com$request_uri;
Save your file and your’re done.
Thank you!