Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Remove query string from url with page anchor


tweetfeeder - 1:02 pm on Sep 19, 2010 (gmt 0)


If the ?twitterfeed&utm_medium=twitter is appended to your url then somebody has used twitterfeed to post your RSS feed to their twitter page.

If it's your own twitter page, then you may want to do what I'm currently trying to do. Remove that query string in .htaccess

This works for me...

# Enable mod_rewrite
Options +FollowSymLinks
#
# Turn on the rewriting engine
RewriteEngine on
#
# If query string is non-blank
RewriteCond %{QUERY_STRING} .
# redirect to remove query string
RewriteRule (.*) [example.com...] [R=301,L]

This works fine for

http://www.example.com/My_Blog/mypage.html?utm_source=twitterfeed&utm_medium=twitter

The only problem I've encountered is that if the link is to an anchor on a page

http://www.example.com/My_Blog/mypage.html#c123456?utm_source=twitterfeed&utm_medium=twitter

the redirect ceases to work.

Anyone know how to change my code so that

http://www.example.com/My_Blog/mypage.html#c123456?utm_source=twitterfeed&utm_medium=twitter

redirects to

http://www.example.com/My_Blog/mypage.html#c123456

Thanks


Thread source:: http://www.webmasterworld.com/apache/4203833.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com