How can I send all traffic to a single index.php file regardless of path or domain? What is the fastest way to do this in nginx.conf? try_files?
Thanks for insight
# Assuming you want static files as well
server {
listen 80 default_server; # Use default; instead if you're still on 0.7.x.
try_files $uri /index.php;
# Standard PHP location block here.
}
# Assuming you do not want static files as well
server {
listen 80 default_server; # Use default; instead if you're still on 0.7.x.
location = /index.php {
# Fastcgi/proxy pass
}
location / {
rewrite ^ /index.php last;
}
}
First answer that came to mind, i suppose you can put this wherever it benefits you the most.
rewrite .* /index.php;