• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Forcing url without www. (Prevent duplicate content) 1.0.0

No permission to download

Zephyr

Well-known member
#1

Kainzo

Active member
#7
This webpage has a redirect loop

The webpage at http://www.herocraftonline.com/main/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Whenever I put this in heh...
 

Arkshine

Active member
#8
If interested :

nginx :
Code:
server
{
    listen          80;
    server_name     www.site.com;
 
    return 301      http://site.com$request_uri;
}
 
server
{
    listen          80;
    server_name    site.com;
 
    // ...
}
varnish :
Code:
sub vcl_recv
{
    if( req.http.host == "www.site.com" )
    {
        error 301;
    }
 
    // ...
}
 
sub vcl_error
{
    if( obj.status == 301 && req.http.host == "www.site.com" )
    {
        set obj.http.Location = "http://site.com" + req.url;
        set obj.status = 301;
        return( deliver );
    }
 
    // ...
}