Non-WWW site redirects to WWW explicitly?

4

I recently moved my NodeJS app to a new Openshift server.

Visiting www.lsmsaSGO.com works as expected. Visiting lsmsaSGO.com seems to redirect explicitly to www.lsmsaSGO.com in the URL bar. I do not want this behavior.

I have another site set up almost identically which will use non WWW domains if the user types elsealabs.com, but will use WWW domains if the user types www.elsealabs.com. This is the desired behavior for lsmsaSGO.com.

Do I need the page rule in the final image? Can anyone help or offer some advice on how to obtain this behavior?

Website Information on Openshift Website Information on Cloudflare Website Information on Cloudflare

Connorelsea

Posted 2015-11-13T18:23:53.270

Reputation: 145

You may also want to replace the forwarding rule you deleted with a reverse one, so that any www.ismsasgo.com/whatever links you might have floating around will get redirected to ismsasgo.com/whatever. – Ilmari Karonen – 2015-11-13T20:09:18.860

Answers

7

I don't know anything about Openshift, but that last image certainly looks like it's doing a permanent redirect (a 301) from lsmsasgo.com/<anything> to www.lsmsasgo.com/<anything>. What happens if you delete that? Or change the www to xyz? The xyz page won't load, but you should see the redirect change from lsmsasgo.com -> www.lsmsasgo.com to lsmsasgo.com -> xyy.lsmassgo.com, which will tell you it is that setting.

blm

Posted 2015-11-13T18:23:53.270

Reputation: 620

-1

Explicitly redirecting to "www.yoursite.com" is usually done with a .htaccess file in the root of you site.

Check if there is anything in there that looks something like this;

RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

Change it to the following:

#RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
#RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

Fred

Posted 2015-11-13T18:23:53.270

Reputation: 1

why -1 for this answer? DNS maps a domain name to an IP address. Web redirects is the job of the webs server or do you want to tell me that millions of webmasters has done it wrong all the time.

I will remove this comment if you can give me an explanation of why my answer is wrong. – Fred – 2015-11-28T12:20:54.617

This depends on whether the web server supports .htaccess (Apache, LiteSpeed). As he's using NodeJS, it's more likely nginx/lighttpd, but I could be wrong. – Michael Bates – 2015-12-23T18:43:36.940

Fair enough Michael I agree with you. However rewrites are still to be done at server level and not at DNS level.

After a quick search I found this https://gist.github.com/felipelavinz/1780150

I admit I have no idea about ngnix or lighttpd and no idea if that info is outdated or not. I was merely trying to point the OP in a direction to solve his problem.

– Fred – 2016-02-19T17:13:33.033