Welcome! Log In Create A New Profile

Advanced

Rewrite to index.php on URI detection

Posted by mm_nginx 
Rewrite to index.php on URI detection
July 08, 2016 06:45AM
Hi folks, I'm attempting to achieve something which is probably quite routine but it's really kicking my ass and i'd appreciate some guidance.

I have a single root directory lets call it /var/www/site/example.com with various different versions of the code living in subdirectories inside it. Like this:

/var/www/site/example.com/1-1-7
/var/www/site/example.com/1-1-8
/var/www/site/example.com/1-1-9

URI requests will always contain the subdirectory name and nginx should catch the request and rewrite it to index.php within the appropriate subdirectory.

For example if the request is www.example.com/1-1-8/getsessionkey the request should be rewritten to index.php within /var/www/site/examples.com/1-1-8/web/index.php

I've attached the nginx config i'm currently using, any assistance much appreciated.

Thanks!
Attachments:
open | download - example.com (1.6 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready