Search code examples
phpnginxurl-rewritingdirectorylighttpd

nginx rewrite file location


In my application, I am trying to link http://domain.com/accounts/login and /accounts/register to http://domain.com/accounts.php?action=$ where $ is this: http://domain.com/accounts/$

I don't know where to define the rewrite and what to put down.

I have access to the entire VPS via SSH, but I'm not sure what file to edit. So where is the file located?

I checked the /opt/ folder, it appears to be empty. I might be running lighttpd, so can you help me out for both instances? Otherwise, can you tell me how to check whether I use lighttpd.


Solution

  • rewrite /accounts/(login|register) /accounts.php?action=$1
    

    should do the trick. Put it inside your server (or location) directive.