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

1
  • 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. Commented Nov 13, 2015 at 20:09

2 Answers 2

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.

-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]
3
  • 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
    Commented Nov 28, 2015 at 12:20
  • 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. Commented Dec 23, 2015 at 18:43
  • 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 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
    Commented Feb 19, 2016 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .