Redirect other subdomain to www version?

On my domain there was some old subdomains like etc

These aren’t used anymore but have links and traffic. So I want to 301 redirect them to my homepage which is

So how would I do that? Thanks

First you create an HTML site:

ee site create --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

There is a location block containing:

location / {
    try_files $uri $uri/ =404;

Just replace the try_files line with:

return 301$request_uri;

Save your file and your’re done.

1 Like

Thank you!