Could somebody convert this .htaccess to NGINX rewrite,,?

could somebody convert this .htaccess to NGINX rewrite,??

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.(.+)$
RewriteRule ^(.*)$ http://%1/$1

i u could, u’re the best !

Posted at Nginx Forum:

if($host ~* ^www.(.+)$)
{
set $sub_name $1;
rewrite ^ http://$1$request_uri
}

right?

2010/4/12 escavern [email protected]:

Also, see
http://b.lesseverything.com/2008/4/9/redirect-from-www-to-non-www-using-nginxfor
a configuration snippet. It’s important to use a 301 redirect, for SEO
purposes.


Gabriel Evans
http://gabevans.com/

On 12.04.2010, at 9:39, escavern wrote:

could somebody convert this .htaccess to NGINX rewrite,??

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.(.+)$
RewriteRule ^(.*)$ http://%1/$1

Could you please try this:

server
{
server_name ~^www.(.+)$;
set $name $1;
rewrite ^ http://$name$uri? permanent;
}

i u could, u’re the best !

Best regards,
Peter.

This maybe the best.

Read Converting rewrite rules