– – – – – – – – – – – – – – –
I had to switch back to the old copy of the ATPP WordPress plugin. My problem is most likely due to a configuration problem on my end, but I was getting hammered by HEAD and GET requests from Babelfish and WorldLingo.
Here is the code.
var browser_url = location.pathname
var server_url = “<?php echo(@$_SERVER[‘REQUEST_URI’]); ?>”
var orig_link = “<?php bloginfo(‘url’);echo(@$_SERVER[‘REQUEST_URI’]); ?>”
if ( browser_url !== server_url )
document.write(‘<p>Please note: This page was originally written in English.</p>’)
document.write(‘<p>The text has been translated using an online service such as Google or Babelfish.</p>’)
document.write(‘<p>The original page can be viewed <a href=”‘,orig_link,'”>here</a>.</p>’)
If you click on http://blog.dembowski.net/archives/de/ the server will still see it as http://blog.dembowski.net/archives/ (without the /de/ at the end). The browser will see the real URL with the /de/ and compare what the server is reporting. If the two are different then the notice is displayed.
The notice will also be displayed if someone used /?p=123 to access a post. That’s not how my permalinks are setup so I’m not concerned about it.