Rewrite Rules from apache

Daniel daniel at linux-nerd.de
Thu Jul 7 17:26:36 UTC 2016


Same issue.

All images CSS Files and so on are not loaded :(


> Am 07.07.2016 um 19:19 schrieb pratyush at hostindya.com:
> 
> July 7 2016 10:19 PM, "Daniel" <daniel at linux-nerd.de> wrote:
>> Hi Everyone,
>> 
>> i try to convert some rules from apache htaccess to nginx.
>> 
>> This is my htaccess Rule:
>> 
>> RewriteCond %{DOCUMENT_ROOT}/$3 -f
>> RewriteRule ^(.*?)/(.*?)/(.*)$ /$3
>> 
>> I tried these options but it seems not working:
>> 
>> if (-f $document_root/$3){
>> set $rule_0 1$rule_0;
>> }
>> if ($rule_0 = "1"){
>> rewrite ^/(.*?)/(.*?)/(.*)$ /$3;
>> }
>> 
>> Anyone have a good idea?
>> 
>> Cheers
>> 
>> Daniel
>> 
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
> 
> 
> how about
> 
> location ^/(.*?)/(.*?)/(.*)/(.*)$ {
>    try_files /$3 $uri =404;
> }
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list