SEO Redirect

Discussion in 'Feature Requests' started by undoIT, Oct 28, 2013.

  1. undoIT

    undoIT New Member

    The proper way to create a redirect for either www.domain.tld => domain.tld or domain.tld => www.domain.tld is not to use a rewrite but to define a separate server with a return:

    http://nginx.org/en/docs/http/converting_rewrite_rules.html

    There is no way to do this properly in ISPconfig. It is necessary to manually edit the /etc/nginx/sites-available/example.com.vhost file. However, any time the website is edited and saved from ISPconfig, the vhost file gets over-written and the separate server definition is lost. Please adjust the Redirect section so that www.domain.tld => domain.tld and domain.tld => www.domain.tld are properly generated, i.e.:

    Code:
    server {
        listen xxx.xxx.xxx.xxx:80;
        listen xxx.xxx.xxx.xxx:443 ssl;
        server_name www.example.come;
        return 301 http://example.com$request_uri;
    }
    
    server {
        listen xxx.xxx.xxx.xxx:80;
        listen xxx.xxx.xxx.xxx:443 ssl;
        server_name example.com;
        root   /var/www/example.com/web;
        ...
    }
     

Share This Page