I have a website running on nginx and my index file is inside a folder. /folder/index.php
I asked my website host to add a "index" directive but they said it is not possible (insecure) and told me to do that by RewriteRule.
So every time that someone type my web address, he need to goes to /folder/file.php
But is not that simple, because I also need that when someone clicks on my banners, I receive the strings from Google URL Builder.
And there is more: my website allows the user to make its own URL, like mydomain.com/user so I already have this RewriteRule:
^/([a-z,0-9,A-Z,_-]+)$ /myhotsite.php?ID=$1
flag: Continue (last)
The myhotsite.php handles the query and mount the webpage based on a MySQL consult.
So let me try to explain in topics:
- mydomain.com -> /folder/file.php
- mydomain.com/?utm_source=blablabla -> /folder/file.php/?utm_source=blablabla
- mydomain.com/* -> nothing happens, no redirect, it keeps my current rewrite rule that goes to /myhotsite.php?ID=$1
In case 2, I need to keep the query strings, that will go to Google Analytics (as long as I'm concerned, I need to use QSA, but not sure how to)
So, how do you think that we can solve this in the easiest way?
And which rule will have priority: the one that I already have or the one that you will help me to create?