Title: Get rid of weird hash in url
Tags: php;url
Question: I have this problem: In my .php file i have following a element:
<?php
$alias = $videos[$videoIndex]["alias"];
$urlHref = $domain . '/play.php?alias=' . $alias;
echo '<a href="' . $urlHref . '" class="vid"&gt;';
?&gt;
then href attribute looks like:
http://mypage123.com/template1/play.php?alias=name
But after click on it, it open site with following url:
http://mypage123.com/template1/play.php?alias=name#.U6fudvmSxNo
I don`t get it, why is there this weird hash. Can I get rid of it? Did I something wrong
Comment: It's probably caused by the js on that page.

Here is the accepted answer: Are you by change using another plugin (example: for statistics)?
AddThis, for instance appends a hash, and a string to your URLs.
I know it because it has happened to my pages!
Comment for this answer: Well... I got worried about the security of my site when these `things` appended themselves to my URLs. Also, on a personal note, it was annoying. So I stripped my site to its bare essentials and added my scripts back, one at a time, and was surprised to discover that it was AddThis. I did some googling and confirmed my suspicions. To this day, however, I haven't found a solution to this inconvenience.
Comment for this answer: Thank you, this hash was caused by AddThis. And how did you figure it out? Is there any way to have AddThis plugin without this hash?

Here is another answer: convert your $alias field  to url friendly string first
ie. use
$alias=urlencode($alias);
Comment for this answer: on retrieve use urldecode(); to decode and get original string

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:06/23/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<php><url>', 'Title': 'Get rid of weird hash in url', 'ViewCount': 65, 'id': 24362257, 'user_AboutMe': '<p>I simply love programming</p>\n', 'user_AccountId': 3580291.0, 'user_DisplayName': 'kennySystemExit', 'user_Reputation': 319.0, 'user_Views': 69.0, 'user_id': 2988670.0}}