I have uncommented the following. Where it was working fine until a few days back. Where i had commented it back and uncommented. And now with i use my domain name without www it opens up a "Sentora" control panel login. How do i go about resolving this?

Below is the modified file. Where i had just removed comment for the lines to redirect url to with www. line number 93. Below is the modified document.

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

Also tried the following:

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:
# RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

Also have replaced the entire file with a new file from another VM instance. And also restarted apache and also all ctlscript.sh but nothing working. the non-www version does not redirect to www version.

The first line is the Apache's redirect because I accessed through example.com instead of www.example.com. Could you share the Apache's log lines after making the request? Maybe that could help us to address the issue.

Also, how are you domain configured? Did you modify the /etc/hosts file or do you have an existent domain pointing to your site?

The htaccess file is as per below and here is the link to the access_log.txt file.

# If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # uncomment the following: RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment the following: # RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

There was nothing generated when a non-www domain was entered on "Incognito (Chrome)/Private mode (Firefox)", but when i entered it on a normal browser on firefox it generated some lines. But nothing on normal chrome.

Is 13.67.57.196 your public IP or the private one? You have to ensure that IP is the same that the one you configured with your domain. We are going to use dev.bizoholic.com and www.dev.bizoholic.com to access your site instead of your domain.

Example, if you can access your site trough 111.222.333.444 then, you have to modify the /etc/hosts and set that IP in the lines you added.

Once you can access your site with dev.bizoholic.com and www.dev.bizoholic.com do the steps I suggested you.