php - NGINX Folder to ROOT redirect / rewrite

934

My question is the following: i want to redirect 301 from a folder to root

https://www.mydomain.de/shop to

https://www.mydomain.de/

with .htacces i would create a 301 redirect. how do i do it with NGINX thanks

805

Answer

Solution:

You should add this rules in server block:

location ~ /shop/ {
            rewrite ^ https://$host permanent;
    }

People are also looking for solutions to the problem: What's the biggest number PHP can handle?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.