Re:Nginx 1.6.0 stable released
by saurik on Thursday April 24, 2014 @12:29PM
(#7641269)
foo.com/* -> www.foo.com/* seems "cleaner" to me than your opposite, due to the issues with cookie leaking, CDN hosting, "normal user" expectations, etc. Like, please appreciate that your usage of "cleaner" is at best subjective ;P. (And I don't quite understand how you are intending to do "foo.com/ -> foo.com"... all URLs must have a path: you can't just GET, you have to GET /.)
[ Parent
| on HN ]
Re:Nginx 1.6.0 stable released
by marshallford on Thursday April 24, 2014 @12:37PM
(#7641321)
I understand the redirecting to non-www is subjective, however I find less characters in the URL is cleaner. Also for a majority of my projects cookies are not used, so it is not a big deal to use a non-www base url.(Static blogs and simple vanilla sites for various school projects, etc).
Also as far as foo.com/ -> foo.com, I was referring to the URL, not the acutal path.
example: https://www.google.com/ redirects to https://www.google.com correct? Maybe I am missing something...
No, that's just your browser (annoyingly) removing the trailing slash from URL shown in the address bar.
http://www.foo.com/ is the "correct" URL. Remember how HTTP works -- you connect to foo.com port 80, then "GET / HTTP/1.1". You can't just omit the "/" and expect it to work.
HTTP clients will just request "/" if no path is specified, so nginx will never even see a request that matches "^foo.com$". You'll cause an infinite redirect loop if you try to force the issue.
No, it doesn't redirect.
$ curl -I https://www.google.com/
HTTP/1.1 200 OK
Re:Nginx 1.6.0 stable released
by odonnellryan on Friday April 25, 2014 @07:46AM
(#7645824)
I think that's just your browser removing the trailing slash.
Re:Nginx 1.6.0 stable released
by marshallford on Friday April 25, 2014 @11:09AM
(#7646977)
oh right, that makes more sense.