I just want to convert this following code to Nginx.
Kindly suggest me.
Thank you very much.
=========================================
if($ip)
{
open(FILE,">$c->{htdocs_dir}/$rand/.htaccess");
$ip=~s/\./\\./g;
$file_name=~s/\s/_/g;
print FILE qq[RewriteEngine on\nRewriteCond %{REMOTE_ADDR} !^$ip\nRewriteRule ^.*\$ "$c->{site_url}/404.html?$c->{site_url}/$f->{file_code1}/$file_name.html"];
close FILE;
}
========================================