removing extra characters Facebook adds at the end of URL
-
A few days ago I noticed that Facebook started adding
?hc_location=ufi
to the end of URLs clicked in Facebook comments. This is causing me some issues and I would like the extra characters stripped off.It was suggested that I put this code in my .htaccess file to strip the extra characters.
#Removing Facebook's referrer information <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{QUERY_STRING} ^hc_location=.* RewriteRule ^(.*)$ /$1? [R=301,L] </IfModule>
This does strip the characters but doesn’t work for my site. My site is not installed at the .com level but at .com/blog. The above code strips the
blog
part out of the url. This is currently at the top of my .htaccess file which I assumes adds the blog part onto any URLs.# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> # END WordPress
Is there a way to combine both sets of code so that it will strip off the extra characters and do whatever it is supposed to do in the second set of code?
Thank you.
- The topic ‘removing extra characters Facebook adds at the end of URL’ is closed to new replies.