I've the following nginx conf:
server {
server_name tawp.in;
location / {
rewrite ^/r/([^/]*)$ /s/ta/$1;
rewrite ^/e/(.*)$ /en/ta/$1;
uwsgi_pass unix:/tmp/uwsgi.sock;
uwsgi_param UWSGI_CHDIR /home/yuvipanda/sites/wikishortipy;
uwsgi_param UWSGI_CALLABLE app;
uwsgi_param UWSGI_MODULE app;
uwsgi_param UWSGI_FILE /home/yuvipanda/sites/wikishortipy/app.py;
uwsgi_param UWSGI_SETENV WIKISHORTIPY_SETTINGS=/home/yuvipanda/sites/wikishortipy/settings.py;
include uwsgi_params;
}
}
I'd expect the two rewrite rules to just rewrite internally, but they're causing external 301 redirects to be sent. What am I doing wrong?
You can check the site at tawp.in/r/3 to see the extra redirect.
Edit: Adding the last
flag to the rewrites doesn't help (as it shouldn't)