How to setup redirects for a large number of posts - redirect

I am working on a major site migration for alpinezone.com . As part of that migration, I moved all the news articles from vbulletin into wordpress cms. The vbulletin articles were previousyl pulled out via a plugin called GARS.
In any event, I have 3400 news articles over the course of five years or so. They are presently in the following format:
news.alpinezone.com/12345
If the title of the news article was "Sugarloaf Sets World Record" then the new location will be
alpinezone.com/sugarloaf-sets-world-record/
Is there a way for me to automate creating the necessary redirects that take the title from the literal page 12345 and convert into a URL?
Finally; the additional trick is that since I did a VB upgrade the existing news articles no longer show up. So going to news.alpinezone.com/12345 won't show anything right now, you need to pull up the forum thread (which is typically hidden) by taking that identifier and going to http://forums.alpinezone.com/showthread.php?12345 to see the actual title. I can pull all this from the WP database, (since all the posts are from a user AlpineZone News).
Any ideas? I'm fairly new to this and the added complexity of subdomains is somethign I am trying to figure out. Thx!

you could make your own showthread.php file in the correct location it was previously located.
have it use the passed id, retrieve the associated record from your database.
Construct the new url by turning the title to lowercase and changing spaces to - and do a redirect via header('Location: new url here');

Related

Duplicate Title Tags Webmaster Tools - URL 1: Has No Date, URL 2: Has Date Appended

So just going through GOogle Webmaster to clean out some 404's and check overall site health, and I've only just discovered about 200 posts that have been flagged as having Duplicate Title Tags.
So here's one common example. Post seems to have two versions, one with out the date format and one with. There isn't two versions of the post in the database, so it's just the one post but I guess has been indexed twice. I do believe I played with changing Permalink format a while back, to remove the date, so pretty sure this would be the few posts that slipped through.
https://www.dropbox.com/s/i2kono8jba0m6m0/Screenshot%202014-03-10%2014.41.53.jpg
Alternative NFL Team Logo Designs by Justin Halpern
/alternative-nfl-team-logo-designs-by-justin-halpern/2012/02/02
/alternative-nfl-team-logo-designs-by-justin-halpern
Wondering the easiest way to simply ignore/fix/noindex/redirect the 'non date' version (last line) for all these few 100 posts.
To clarify my permalink structure is:
imjustcreative.com/example-post/2012/02/02
I did think I could use Yoasts Canonical Link feature in each 'edit post' and set the canonical link appropriately, but not sure if that's possible as each post is viewable in it's own formate, ie I can view each of the post versions without any automatic URL structure change.
So kind, :)
Graham

Error parsing input URL, no data was scraped. only with new pages on my site

The problem i have is that i own a website where other people can post stuff ,creating new pages on my domain, but the problem that occured today is that all the new post pages created today are malfunctioning , sharing is not loading thumbnail picture and title and so on, but the weird this is that all the posts(new pages) created before today are all working fine
What caused an error to occur out of nowhere?
I also cannot debug any of the URL's of my website as the same error: Error parsing input URL, no data was scraped
The website im having problems with is here http://www.vabameedia.ee/vm/184/h%C3%A4da-ei-anna-h%C3%A4beneda.html
This is one of the sites where it says no error on page but facebook still cant reach it. http://www.vabameedia.ee/vm/178/craig-parks-%C3%BChek%C3%A4eline-krossisoitja.html
For people experiencing the same problem but for different causes, I discovered a few interesting things about how Facebook "scrapes" pages, checking the logs of the server while doing some trials.
First of all: if you never tried to share a page with FB, FB never tried to scrape it, and it will not try to do so if you only put the url in the Debug tool.
That's the first reason because you get the error: it just states that FB has no information on the page, you must "force" it to scrape the page.
The first time you try to share a page, FB scrapes it (asks your server the first 40k of the page and analyse the opengraph tags).
What can happen is that you do not see the image: Facebook Share Dialog does not display thumbnails one first load
The reason is that FB behind the scenes is still scraping your page and caching the image. The next time, in fact, you have also the image.
How to solve it? Pre caching: https://developers.facebook.com/docs/sharing/best-practices#precaching
or simply add
<meta property="og:image:width" content="450"/>
<meta property="og:image:height" content="298"/>
I was pulling my hair out trying to fix this issue. Hours and hours of troubleshooting to no avail. After speaking with one of our programmers about a topic unrelated I thought of something to try as a long shot.
Much to my surprise, it worked!!!
This is the reason behind the problem and my solution for it:
When you draft a post in WordPress it generates a link based on your article's title (unless you manually change it). The title of my article included special characters, however the auto-generated link didn't display these special characters, only hyphens to replace the spaces. Should be fine right? Wrong! Somewhere embedded in metadata and code in the WordPress platform are those special characters and they mess up the way Facebook pulls info from the article being linked to. This is a problem because certain special characters invalidate hyperlinks.
For example:
Article Title: R[eloaded]
Auto-generated hyperlink DISPLAYED in WordPress "Permalink" field: http://www.example.com/reloaded
Actual WordPress Auto-generated hyperlink: http://www.example.com/r[eloaded]
Those brackets will invalidate the link and Facebook will be unable to pull any information (ie pictures) from it.
Solution:
(1) Simply, manually change the WordPress hyperlink address to something that doesn't include any special characters (this will not change the title of your article).
(2) Click "Update" to change the post to include the new hyperlink.
(3) Click "Purge from Cache" in the WordPress window
(4) Refresh your Facebook browser window
(5) Paste the new hyperlink for your article
(6) Enjoy your Facebook post with a preview image and information
Sidenote: Don't pull your hair out over Facebook, it's not worth it. =)
If you're using Wordpress, edit the post in question to change the permalink (just alter it slightly), then update the post. Using the new permalink in the Facebook OG debugger should now work.
It's a weird fix, but I think it takes care of a problem caused by special characters being used in the title of a post, which is then used to make the permalink.
Its all about DNS issue, was having same issue and resolved it by updating domain name servers to actual name servers.
In my case my domain was pointed to ns1.websterz.net and ns2.websterz.net and on this server i had DNS redirect to my other server (where web site is hosted). I Just updated name servers of the domain to actual name servers where my web site is hosted on. This was account migration case i forgot to update name servers as of new server.
Everything works fine now.

facebook comments widget - how to monitor latest comments?

I have over 10,000 pages on my website. I just created a php script to automatically integrate the facebook comments widget into each pages.
However, i was wondering if there is a way to monitor the latest comments added to my website so i don't have to browse through 10,000 pages to see the latest comments.
I am also wondering if i will be able to delete comments by other users ? How can facebook tell that i am the webmaster of the page ? If some user leave nasty comments on one of the pages i want to be able to delete them
Facebook's Graph API allows you to query for Facebook data, including comments. It's pretty easy to use but does require a bit of code to make web requests, parse JSON, etc. You can pass in filters, such as only wanting comments after a certain date, which makes querying for "new comments" simple.
The API will return all comments (even those deleted by you; afaik there is no way to tell whether a particular comment has been deleted). The results are returned in pages, so importing a lot of comments can take a bit (as you need multiple round-trips). Also, there is no way to use the API to delete posts - this has to go through the Facebook web pages (or some other means I don't know about).
The documentation pages are pretty exhaustive and will explain how to get started.
Hello if you want to add face book comment box in your website . then just go to face book plugin's and copy the comment box (CODE) .
now open your website admin penal . if your website created in blogger then go to layout . if in other setup. then go to plugin's . you see some layout hear add your code in (top down ) bar .
if you doesn't understand then 2nd way.
go to website and open your dashboard now go to website template . now edit the template .
now you see some codes in new tab . scroll down and put your cods in HTML Body place .
i think you understand : for more shahzebraza425#yahoo .com / www.megaphotocompetition .com /
www.shahzebraza .tk / www.wuwsoftware .tk

How to define what will be inserted in share message?

I have an app with blog records per each user. I have add share button to my app, to give ability to post interesting blog records to users time line or to send to other user. But in default it takes image and text for share as it wants and not always correctly. So I find out that it can be dirven by meta tags (using for example "image" property to set image for share dialog). That's work ok on main page (where I'd like to make ability share with whole application), but on pages of blog records I cann`t customize it. meta tag should be in , but all info (short text and image of blog post) I get later in body, so I can insert it. How can I manage with this? Or may be there is another way to share content with?
What blog engine are you using? If it is a wordpress - try this plugin http://wordpress.org/extend/plugins/facebook-share-new/ from offician facebook docs http://developers.facebook.com/docs/. Otherwise I'd suggest to find a facebook plugin for your blog engine using google and install it.

How do I transfer Comments from one Facebook App ID to Another?

Is there any way to transfer comments from a "deleted" Facebook app (that is still receiving comments) to a new app id? The app was deleted by accident quite some time ago but we now have thousands of comments that have been entered using it. I'm afraid I will lose all of the comments if I simply switch to a new app. The app id seems to function just fine with the commenting mechanism, but I can't manage it or use it in any other way.
AFAIK, there is no automated way of doing this. However, you can read them programatically from your deleted app (provided you have the permissions) and then post it again on your new app.
You can get the original app's feed using the following (PHP) code:
$response=file_get_contents("https://graph.facebook.com/".$id."/feed&access_token=".$facebook_access_token);
$response_array=json_decode($response,true);
// $id: ID of the page where the comments are
You can also customize this query by adding pagination parameters like since,limit,until etc. Please refer to https://developers.facebook.com/docs/reference/api/ for documentation.
And can be reposted to your app by HTTP POSTing to the same URL. See https://developers.facebook.com/docs/reference/api/page/#posts for details.
Please understand that you can't post as the original author - so you can only post the text and perhaps manually add the context of the original author. so i.e:
"Shreeni: 'This is a cool app' "
will have to become
"App: 'Shreeni said: 'This is a cool app' ' "