htaccess rewrite conversion ?

Phillip Oldham phill at activityhq.com
Tue Nov 10 11:48:56 MSK 2009


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} !^$
> RewriteCond %{HTTP_REFERER} !^http://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} !^http://www.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 
>   
http://wiki.nginx.org/NginxHttpMapModule
http://wiki.nginx.org/NginxHttpRewriteModule







More information about the nginx mailing list