Htaccess rewrite conversion?

I’m thinking of converting a forum site from apache to nginx but they
have this .htaccess in root of their account and not sure if there’s a
nginx equivalent ??

Any help would be appreciated :slight_smile:

htaccess contents are:

RewriteEngine on
ErrorDocument 404 /foro/404.php
RedirectMatch 301 “^/forum/?$” “http://www.domain.com/foro

order allow,deny
allow from all

deny from 201.xxx.xx.xxRewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^Website Domain Names, Online Stores & Hosting | Domain.com
RewriteCond %{HTTP_REFERER} !^http://domain.com$
RewriteCond %{HTTP_REFERER} !^http://jorn.domain.com/.*$
RewriteCond %{HTTP_REFERER} !^http://jorn.domain.com$
RewriteCond %{HTTP_REFERER} !^http://webring.domain.com/.*$
RewriteCond %{HTTP_REFERER} !^http://webring.domain.com$
RewriteCond %{HTTP_REFERER} !^Website Domain Names, Online Stores & Hosting | Domain.com
RewriteCond %{HTTP_REFERER} !^http://www.domain.com$
RewriteCond %{HTTP_REFERER} !^http://www.jorn.domain.com/.*$
RewriteCond %{HTTP_REFERER} !^http://www.jorn.domain.com$
RewriteCond %{HTTP_REFERER} !^http://www.webring.domain.com/.*$
RewriteCond %{HTTP_REFERER} !^http://www.webring.domain.com$
RewriteRule .*.(jpg|JPG|JPEG|GIF|jpeg|gif|png|bmp|mov|mpeg|mpg)$
http://www.domain.com

Posted at Nginx Forum:

George wrote:

I’m thinking of converting a forum site from apache to nginx but they have this .htaccess in root of their account and not sure if there’s a nginx equivalent ??

Nginx doesn’t have .htaccess so you’ll need to put the directives in the
config file for the website.

RewriteEngine on
ErrorDocument 404 /foro/404.php
RedirectMatch 301 “^/forum/?$” “http://www.domain.com/foro

http://wiki.nginx.org/NginxHttpRewriteModule

order allow,deny
allow from all
deny from 201.xxx.xx.xxRewriteCond %{HTTP_REFERER} !^$

http://wiki.nginx.org/NginxHttpAccessModule

RewriteCond %{HTTP_REFERER} !^http://www.jorn.domain.com$
RewriteCond %{HTTP_REFERER} !^http://www.webring.domain.com/.*$
RewriteCond %{HTTP_REFERER} !^http://www.webring.domain.com$
RewriteRule .*.(jpg|JPG|JPEG|GIF|jpeg|gif|png|bmp|mov|mpeg|mpg)$ http://www.domain.com

http://wiki.nginx.org/NginxHttpMapModule
http://wiki.nginx.org/NginxHttpRewriteModule