tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: encodeURL, jsessionid and mod_rewrite ?
Date Sun, 08 Oct 2017 17:30:56 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Laurent,

On 10/4/17 6:31 PM, Laurent Perez wrote:
> Obviously I'm thinking about renaming the war but the rewriting is
> really used, for example seo friendly urls like /bar/steps/1
> internally rewrite to /foo/somesubmodule/steps.jsp?step=1 and the
> system really can't expose /somesubmodule/steps.jsp?step=1 as
> public urls, it messes with google analytics stats or bookmarked
> urls.

Let's take a typical use-case, here, where you have a beautiful URL
that is lovely for SEO (which, by the way, seems like a fiction to me,
since search engines don't give flying fig about the value of the URL)
and makes flowers grow out of scrap metal.

Let's make that URL
https://example.com/what/a/great/url/just/gorgeous/hashtag/notsad

So you rewrite that URL internally to:

http://internal/RJdo10/8/2017/index.jsp?docId=5

Great, now the search engine has that nice URL and your application
has a pile of garbage to deal with. The user sees the nice URL and
they get their data. Awesome.

Now, what do the URLs look like on the actual page? They look like this:

<p>Other pages you may like:</p>
<ul>
  <li><a href="index.jsp?id=6">Page 6</a></li>
  <li><a href="index.jsp?id=7">Page 7</a></li>
  <li><a href="index.jsp?id=8">Page 8</a></li>
  <li><a href="index.jsp?id=9">Page 9</a></li>
  <li><a href="index.jsp?id=10">Page 10</a></li>
</ul>

(Wasn't 1996 a great time to be on the web?)

When the search engine goes to index your page, it'll get your
beautiful URL from wherever it got it, but then it will get these
really ugly ones on the page, too. So your "Page 6" now has an
unsightly URL being leaked-out to your search engines.

How do you fix that?

Content-rewriting to the rescue! It'll be great, you can re-assign
each page to another beautiful URL:

PageID URL
6      https://example.com/astonishingly/well/written/URL
7      https://example.com/surpassed/our/previous/benchmark/for/beauty
8      https://example.com/getting/our/SEO/moneys/worth
9      https://example.com/CEOs/earn/every/penny
10     https://example.com/you/cant/make/this/stuff/up

So, now you get to maintain a huge list of "nice" URLs and their
mappings (in both directions!), plus you get the overhead of
re-writing 100% of the content of your page while it's streaming back
out to the client.

What about HTTP redirects?

Aw, shucks. Now we need to have another layer that checks all response
headers to see if we need to rewrite THOSE.

It becomes miserable, unwieldy, and generates huge amounts of excess
heat performing all of these (IMHO) completely useless operations.
What's the problem with the URL looking like
https://example.com/myapp/index.jsp?docId=5

Maybe I just don't "get" the whole concept of "SEO"... I figure if you
put content on your pages that doesn't suck and only contains the
words that make sense, you'll get the ranking you deserve. Playing
games with your URLs is just going to make more work for everyone.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlnaYM8ACgkQHPApP6U8
pFj11Q//TVhBEm+kBhjt/tVi//NQ1I0ISLs02/F3A0t6fOgYv86j2IMgM9GLaIiS
yg5A5c/PIVIvcLfycssb8BWht9riVp0B8RVg8faeZkPnSCeK61dhylrPLwgKB7M4
eFoqZYKVqmKv0gMRSS3l+fAB0OKjM1LtBSBNpnJROeS5eIii3lOrACqFkiqCjy3p
NMsPB5b9eA9ZJPVtZMjARTndpqwSI/L44DcW+dwVveUvK6rXzXzqjy7G5MCDs6gM
ge51pqb9jd+oXd+Rnb6vKEN4JTn5mtDx7dKohpJDrqtFa0bwL1rxL5LLd/berFRD
dc4s0K2relxywWsVtrZfgCsuyqMJ9FAv/V9nZhB/Z8vq2WBep92pv9e1zXPF8Ijw
sbpx+23FKzOsIRe7o2Gj5yezEkno1Tgws1Q79W6TZZzsnRTOvrx2zdfrIh/e6zFC
XJBuU5cYdEYRIV1JbIzeupOyQdKc9B7KEgFWuaMOkT/T5peMXTGLZ+7+/TW1r2Mb
8vQVpQbIox3qa/0Xw+n0fts9zxZqHRpBgLv0UTL8Zr7keMgAWS3whYZQ05iS8cdd
W5Jnsl8ZeYWDeKzALwYgmWo3NdxBuHZJ7YuiB3XE1SeIpvQ3GLApBVabG+q205T2
B2d74VuioRgGMW6Gscu2zaGsQAjfFSoNxegGGChQBDqIZu9oU3g=
=NWa9
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message