Open ckjpn opened 8 years ago
Why?
It's easy to do, it's a shorter URL, and it's an easier URL to remember..
It also makes a nice-looking URL when people are quoting sentences and their sources in research papers, and perhaps even on other websites and in social media such as twitter.
Is there really any disadvantage?
Why not go ahead an put it in the .htacess file of dev.tatoeba.org and test it? I think you and others might like it.
I had it at a4esl.com and used it quite frequently with no problems. However, I've now quit using that server and just have a4esl.com forward to a4esl.org, so you cannot see it working there now.
Is there really any disadvantage?
Using it will bring us to the English interface, no? So people using one of the other interfaces will have to change back every time.
I don't think it will. The interface is decided by cookies, I think.
Anyway, the /eng/ part of the URL in the RewriteRule can be omitted.
RewriteEngine on RewriteRule ^(\d+)$ http://tatoeba.org/sentences/show/$1 [R,NC]
Try this without the /eng/ in the URL. https://tatoeba.org/sentences/show/4710414
Paul,
Also, the purpose of this wouldn't be for internal links.
For example, in a research paper, a sentence could be listed this way.
Is there a bank nearby? (tatoeba.org/4710414)
(It's concise, clearly credits the source and also gives the link.)
Instead of one of these ways, ...
Is there a bank nearby? (https://tatoeba.org/sentences/show/4710414) Is there a bank nearby? (Tatoeba Corpus Sentence #4710414) Is there a bank nearby? (Tatoeba Corpus #4710414)
This would also likely be useful in blogs and social media like Twitter.
Is there really any disadvantage?
I don’t see any disadvantage. But I don’t see any substantial advantage neither, except for your personal use, because among the very, very limited number of people quoting Tatoeba in their research papers, you’d be the only one knowing one can use short links. I don’t like feeling like we’re doing things for personal use.
Also, there are literally tons of such things that could be done on Tatoeba. Why not change the color of links? Make bigger buttons? I tend to like keeping things simple and improve when there’s a substantial need. The less code, the less bugs and maintenance. There are already enough things to do on Tatoeba.
Why not go ahead an put it in the .htacess file of dev.tatoeba.org and test it?
Because the piece of code you provided works for Apache whereas we’re using nginx.
That said, if someone wants to do it, go ahead.
This would also likely be useful in blogs and social media like Twitter.
This is a more convincing argument.
One should think about where and how to make users aware of their existence, otherwise there is no point implementing this. Maybe we could somehow make use (or replace) the “Show sentence #” form.
Because the piece of code you provided works for Apache whereas we’re using nginx.
Perhaps this would help. http://winginx.com/en/htaccess
location / { rewrite ^/(\d+)$ http://tatoeba.org/sentences/show/$1 redirect; }
There should be a way to implement this in CakePHP's route.php
Create a shortcut "URL-shortener" like this ... http://tatoeba.org/2236214 ... that forwards to ... https://tatoeba.org/eng/sentences/show/2236214
This can be done by inserting the following into the .htacess file. There should be no problems since there are no URLs on tatoeba.org that have numerals immediately following the domain name.
RewriteEngine on RewriteRule ^(\d+)$ http://tatoeba.org/eng/sentences/show/$1 [R,NC]