How to redirect url with complete slug in easyengine + nginx + html

Hello friends! :laughing:

I have a problem to several days without solution.

I created a subdomain

To redirect all urls of this subdomain (www to no-www), put the following code into the server (/etc/nginx/sites-available/

server_name; return 301 $scheme://$request_uri;

I saved the file and restarted the nginx.

Once configured normally redirects to

The problem is that when an entire slug does not redirect and gives 404, in both cases below: to to

Can anyone give me a light for me to see what I’m doing wrong?



Olá amigos! Estou com um problema a varios dias sem solução.

Criei um subdominio

Para redirecionar todas as urls desse subdominio (de www para no-www), coloquei o seguinte codigo dentro do server (/etc/nginx/sites-available/


Salvei o arquivo e reiniciei o nginx.

Depois de configurado redireciona normalmente de www. para

O problema é que quando é uma slug inteira não redireciona e ainda dá erro 404, em ambos os casos abaixo:

www. para

www. para

Alguem pode me dá uma luz pra mim ver o que estou fazendo de errado?

Have you try adding a (www) CNAME to your Domain in your DNS settings?

Hello sinewaves, thanks for the tip.

I had not put the cname (www) because I had a “record A” with a wildcard (*). Hence I thought only that resolved.

I added the cname now and is redirecting all slugs. Everything okay at that point now.

But still giving 404 error, even with correct slug and the image properly hosted on the server. Any more suggestions?

Thank you very much in advance.


Olá sinewaves, obrigado pela dica.

Eu não havia colocado o cname (www) porque já tinha um “record A” com um caractere coringa (*). Daí pensava que só isso resolvia.

Adicionei o cname agora e está redirecionando todas as slugs. Tudo ok nesse ponto agora.

Pórem continua dando erro 404, mesmo com a slug correta e a imagem devidamente hospedada no servidor. Mais alguma sugestão?

Desde já agradeço.

With fictitious information, my dns settings are as in attached print:

Did you update your host file by adding your ip and to the list? www/root/etc/host


The nginx server was configured with easyengine. I did not find this way you suggest. The server is Debian 7.

You will need to set up a SFTP using like filezilla first, then you can access and modify your Debian root file system. I found this tutorial it may help to do this if your not familiar.

I already have installed SFTP client.

What I said is that I not found the folder: “host” in / etc /

Which of these folders below you refer?



Or refers to some of these files?



Sorry so many questions. It is that I am still in the process of adaptation with nginx. :smirk:

If you navigate to the root folder you will see the etc folder inside that directory you will see your host.conf or host file that file you will need to add the ip & your in the list, restart nginx that’s it.

sinewaves, finally I managed to solve. :slight_smile:

I will leave here the solution found to this issue. If you have someone else with this problem may be useful.

In your SFTP manager navigate to: /etc/nginx/conf.d

Within this directory, create a .conf file can be for example: redirect.conf

server_name; return 301 $scheme://$request_uri;

And then within the redirect.conf place the code, save and restart nginx.

If all went well, you are done magic. :smiley:

Thanks for your help sinewaves.

1 Like


Glad to hear it, And thanks for the final solution. Cheers mate!