I run the following in Apache. Our IT guy recommended Nginx over Apache to optimize web traffic. But modrewrite doesn’t work the same way on Nginx.
Essentially I’m interested in converting all information after the tld to path variables:
So domain.com/abc/def/ redirects to domain.com/index.php/abc/def/
Can you help me do that in Nginx? The following allows this in Apache.
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
# The following redirects all directories to root using PATH variables
# Ex. /abc/def/ redirects to /index.php/abc/def/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]
</IfModule>
Thanks.
The best way to achieve this is:
You could read more about this directive here – http://wiki.nginx.org/HttpCoreModule