cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Redirect HTTPS site from www to non www

I am managing this website - https://navdeeparora.com

The problem is with 301 redirection. I am able to access both https://www.navdeeparora.com and https://navdeeparora.com.

 

Google is crawling both these versions and indexing as well. Google analytics gave an error of redundant host names.

 

Tried redirecting from cPanel and later from htacess

with these 2 different codes - 

# BEGIN SSL

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteCond %{HTTP_HOST} ^(www\.)?navdeeparora\.com$ [NC]

RewriteRule ^$ https://navdeeparora.com$1 [R,L]

# END SSL

 

and 

 

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^www.navdeeparora.com [NC]

RewriteRule ^(.*)$ https://navdeeparora.com/$1 [R=301,L]

 

nothing seems to work.

 

Please help I want to redirect all url variations to https://navdeeparora.com.

P.s - Its not a Wordpress site.

1 REPLY 1

I use Apache 2.4.43.  My web site is wp.scsiraidguru.com.   Here is how I redirect everything to https://wp.scsiraidguru.com

<VirtualHost *:80>
ServerName wp.scsiraidguru.com
ServerAlias www.scsiraidguru.com scsiraidguru.com
Redirect permanent / https://wp.scsiraidguru.com
</VirtualHost>