Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect www to non-www #16

Open
lfilho opened this issue Oct 16, 2016 · 1 comment
Open

Redirect www to non-www #16

lfilho opened this issue Oct 16, 2016 · 1 comment

Comments

@lfilho
Copy link

lfilho commented Oct 16, 2016

Hey there, thanks for work!!

I would like to configure my website to be acessible both from www and non-www. Right now I want to redir from www to non-www, but I would happily go the other way around too.

Right now when users access my www.domain.com it errors out and they are left thinking my site is offline. Of course it is running fine in domain.com.

Is there a way to accomplish that? Or how easy would it be to support it? I'm happy to contribute but bear in mind that i'm still learning nginx/servers world (i'm mainly a frontend dev with basic knowledge on docker, shell, etc).

Thanks

@fisherman818
Copy link

fisherman818 commented Feb 1, 2017

at your nginx site configuration file:

server {
    listen 80;
    server_name www.domain.com;
    return 301 http://domain.com$request_uri;
}

then sudo service nginx restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants