Welcome! Log In Create A New Profile

Advanced

.htaccess to NGINX - Help with rewrite rules and conditions

Posted by fezode 
.htaccess to NGINX - Help with rewrite rules and conditions
November 05, 2009 09:17PM
Hi there,

Can someone please translate the following .htaccess to NGINX, it seems that whatever I try doesn't work as in Apache, I searched the forums and found many posts but non of the posters had the same set of rules I have here, I tried to mix different rules from different answers hoping that it may work but it didn't, anyhow here is the original .htaccess file and any help is greatly appreciated, once we got this figured out we will migrate many of our clients to NGINX :)

[code]
ErrorDocument 403 /index.php?do=/public/error/403/
ErrorDocument 404 /index.php?do=/public/error/404/

RewriteEngine On

RewriteRule ^box/items/(.*) /shelf/box/items/$1 [L]

RewriteCond %{REQUEST_URI} !^/images/.*
RewriteCond %{REQUEST_URI} !^/music/.*
RewriteCond %{REQUEST_URI} !^/video/.*
RewriteCond %{REQUEST_URI} !^/files/.*
RewriteCond %{REQUEST_URI} !^/data/.*
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^index.php(/.*)$ /index.php?do=$1 [L]

RewriteCond %{REQUEST_URI} !^/images/.*
RewriteCond %{REQUEST_URI} !^/music/.*
RewriteCond %{REQUEST_URI} !^/video/.*
RewriteCond %{REQUEST_URI} !^/files/.*
RewriteCond %{REQUEST_URI} !^/data/.*
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.*)$ /index.php?do=/$1 [L]
[/code]

Thanks in advance,
Re: .htaccess to NGINX - Help with rewrite rules and conditions
November 24, 2009 06:55PM
Almost 3 weeks with no answer!

Does this mean that there's no way to translate those roles into NGINX?

Someone step in please and confirm if it's possible or not.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 170
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready