0

I've recently set up a virtual host using nginx. The website being hosted needs to redirect URL's containing '/old/' - to the same url without '/old/'. For example:

www.mywebsite.com/old/a/b/c to www.mywebsite.com/a/b/c www.mywebsite.com/old/a to www.mywebsite.com/a www.mywebsite.com/old/a/b/c/d/e to www.mywebsite.com/a/b/c/d/e 

Can anyone point me in the right direction? Cheers

2 Answers 2

1

Maybe this help:

rewrite ^/old/(.+)$ http://myebsite.com/$1 permanent;

If not try to combine it whit if (!-f $request_filename) { here }

1

For example:

server { server_name www.mywebsite.com; location /old/ { rewrite ^/old/(.*)$ /$1 permanent; } location / { # bla bla bla and other usual stuff } } 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.