3 ms·
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,
by saurik 13y ago
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 /.)
- marshallford 13y agoI 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/ https://www.google.com/ redirects to https://www.google.com https://www.google.com correct? Maybe I am missing something...
- joevandyk 13y agoNo, it doesn't redirect. $ curl -I https://www.google.com/ HTTP/1.1 200 OK
- odonnellryan 13y agoI think that's just your browser removing the trailing slash.
- marshallford 13y agooh right, that makes more sense.
- neckro23 13y agoNo, that's just your browser (annoyingly) removing the trailing slash from URL shown in the address bar. http://www.foo.com/ 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.