Welcome! Log In Create A New Profile

Advanced

Need help with convertineg this htaccess apach.htaccess to nginx

Posted by rangerangel 
Need help with convertineg this htaccess apach.htaccess to nginx
April 04, 2010 03:04PM
[u]apache .htaccess[/u]

ExpiresActive On
ExpiresByType image/gif "access 1 week"
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"
ExpiresByType image/png "access 1 week"
ExpiresByType text/css "access 1 week"
ExpiresByType text/js "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType application/x-javascript "access 1 week"

ErrorDocument 404 http://www.domain.com/

RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^.*$ - [L]
RewriteRule ^index.php$ http://%{http_host}/vb/ [R=301,L]

RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain.com/vb/$1 [L,R=301]

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
Re: Need help with convertineg this htaccess apach.htaccess to nginx
June 04, 2010 06:08AM
For the rewrite rules .
if ($http_host !~ "^www\.domain\.com"){
set $rule_2 1$rule_2;
}
if ($rule_2 = "1"){
rewrite /(.*) http://www.domain.com/vb/$1 permanent;
break;
}
rewrite ^/((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;


location ~* \.(gif|jpg|jpeg|png|js|css|swf)$ {

if (-f $request_filename) {
break;
}
expires 40d;
add_header Cache-Control public;
}

change 40 days to what ever you want .
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready