I'm having a bit of a trouble with nginx and rewriting. Searching on the internet only shows results for rewriting domains or changing request_uri's, but I'm trying to rewrite part of the uri.
Whenever a client connects to site.com it should go to site.com/en but when it connects to site.nl it should go to site.nl/nl (both on the same root files). They're both in their own server block, with the following rewrite rule:
rewrite ^ /en/$request_uri;
This one doesn't really work and also rewrites all the paths to the css and images. Now the biggest problem is probably that there's already a drupal rewrite:
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
Is there any way to combine these or another way to let the user go to the correct url with /en or /nl? Or would this work in Apache?
Edit: I ended up using apache, since that has a simple redirect:
RewriteEngine On
RedirectMatch permanent ^/$ /en