Dear Experts,
I have been trying to figure out what exactly am I missing to get this to work 100%.
**Internal Directory Structure:**
www
www/profiles
www/profiles/random_user_directory_here
www/profiles/random_user_directory_here/index.php
**Desired External Request:**
http://mysite.com/random_user_directory_here
My Question:
Every time a new user on my site creates an account, an internal directory is created with their username.
This directory has an index.php file.
Whenever the user goes to URL http://mysite.com/random_user_directory_here, I Want the server to display the contents of index.php for this user.
My Problem:
The following script works only if the user types http://mysite.com/random_user_directory_here/index.php BUT it does not work if they type http://mysite.com/random_user_directory_here
location ~ ^/([^/]+)/([^/?]+)$ {
alias www/profiles/$1/$2;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME www/profiles/$1/$2$fastcgi_script_name;
include fastcgi_params;
}
Can anyone please explain what I'm missing? I tried just about everything I know but I can't figure it out..
Please feel free to correct my regex if there's anything wrong or extra in it.
Thanks a lot for any help.