Welcome! Log In Create A New Profile

Advanced

just few lines of .htaccess to nginx

Posted by a8319547 
just few lines of .htaccess to nginx
October 21, 2011 03:11PM
Can someone please transform this to nginx. I am very bad at regex and similar stuff. Found this on some boilerplate and need to convert it for nginx usage. I don't know if all off it is important but definitively redirects to index.php and rewrite for pictures and scripts. Thank you :)

<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>

# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
Options -MultiViews

# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or Git.
<IfModule mod_rewrite.c>
RewriteRule "(^|/)\." - [F]
</IfModule>

# php_flag register_globals Off
<IfModule mod_rewrite.c>
# redirect all pages to index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*) /index.php [NC]

# rewrite all picture|css|js requests
RewriteRule ^.+(/(images|css|js)/.+)$ $1 [L]
</IfModule>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready