-1

I have a site on domain.de/webinterface/.

There is a index.php with two get parameters (page & user)

Now i want that domain.de/webinterface/user/Niklas redirects to domain.de/webinterface/index.php?page=user&name=Niklas

I have this atm:

location /webinterface/ {
    rewrite ^/webinterface/([^/]*)/([^/]*)$ /webinterface/index.php?page=$1&name=$2 ;
}

But it doesn't work. Can anyone help me with this qestion?

3
  • That looks OK. What is the problem you are having? Jul 2, 2015 at 18:37
  • please add the log
    – 030
    Jul 2, 2015 at 18:43
  • @MichaelHampton It shows a 404.
    – Niklas
    Jul 2, 2015 at 19:44

1 Answer 1

-1

Try this way:

location /webinterface/ {
    rewrite ^/webinterface/(.*)/(.*)$ /webinterface/index.php?page=$1&name=$2 ;
}

You can check is everything fine with your rewrite rule with curl:

curl -s -D - -o /dev/null domain.de/webinterface/user/Niklas | grep Location

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .