Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to rewrite some url's in nginx and I have an wordpress site with URLs like this:

http://mydomain.com/en/my-content

How can is remove the en/ with nginx?

Thanks a lot.

Peter

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You could remove the /en part with the following rewrite.

rewrite ^/en(.*)$ $1;

share|improve this answer
    
This might be the opposite of what the OP actually wants. I think they want requests to /my-content to actually go to the site at /en/my-content i.e. so the en no longer appears in the URL –  nickgrim Sep 3 '12 at 13:16
    
This snippet doesn`t work on my site. i dont know why. Are there any problems with varnish before the site? –  derpiet Sep 3 '12 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.