How to delete broken/dead links in Joomla 1.5? - php

I'm working on an old project based on Joomla 1.5. Most of its code was written in core php but it does have SEO URLs. I'm required remove dead links (about 2000 URLs) from the site as it is lowering our organic reach.
When I opened each of them, they showed me the 404 Error page of the site. I couldn't figure out what was wrong with that. After all, that's why we have 404 pages, right? .. to display errors when a link is not found over our server, right?
I tried cleaning up Server's Cache and even purging expired cache after reading some tuts. Now that it doesn't seem to help, I'm not sure what to do! So, any helps?
Btw, site is at www.parentune.com
and an example dead link is: http://www.parentune.com/parenting-blog/category/Adoption/latest

You don't have something to remove as it doesn't exist in your site.
You have to create 301 redirects for old url to new to help search engine crawl your updated content.
A 301 redirect example is:
Redirect 301 /oldpage.html /newpage.html
Good Luck!

As I didn't have any new URLs to redirect those old URLs to, but had the list of those reported URLs in an excel file, so what I did is I read the Excel file in an array and matched if $_SERVER['REQUEST_URI'] was in that array (obviously, all the URLs in that array have to be relative to index page). If the URL was found in the array, I simply redirected the page to homepage.
I also cross checked then on brokenlinkcheck.com and then it didn't report those URLs again as 404 URLs. So, seems like the approach fitted as solution! :D

Related

404 page redirects and SEO

I hope this is OK to ask here. I am almost ready to upload a new theme to my blog. Which after some serious consideration and research in SEO I have decided to restructure some of the pages, their child pages and to remove some of the categories.
Unfortunately this will result in various 404 results which will be bad for my site.
What I want to do is this:
On the 404 page, before it loads get last parameter of url, so for example: example.com/parent/child-page-name/
Then perform a check in wordpress using get_page_by_title().
If the page exists get the page permalink then use php header location to send 301 redirect to the new page.
if not, display 404 page with search options etc..
Is this a good way to handle this? is 301 the correct redirect?
To answer your redirect question, yes the 301 redirect is the correct one to use as it passes on the link equity from the last page.
Rather than using PHP to automatically solve your 404 problem when the new blog is launched, I'd crawl your website first and manually redirect all the old links to the new ones. It's tedious, but it will make sure nothing slips through the cracks that an automated process may otherwise miss.
A good way to do this is to crawl your site as it is at the moment, put all the links into a spreadsheet and put the new urls into the next column. From there you can concatenate the urls into a rewrite rule for the .htaccess file.
To show you what I mean, I have set up a basic sheet you can use to help you out.
https://docs.google.com/spreadsheets/d/1htHq0oeATsfrFJpAxKg0_e5dJqSmJ_idrrH-tudkuq4/edit?usp=sharing
Source: Past experience, Commercial SEO Technician for 2 years

wordpress rewrite and google SEO issue

I have a custom wordpress page that I wanted to make its url SEO friendly.
So I added some code using rewrite api to convert this url:
http://example.com/page1/?id=1234
to:
http://example.com/page2/1234
page1 is still there and first url still valid. page1 was not very descriptive so I though that since I'm rewriting the url I might as well rename the page too.
Everything on the website works fine, but when I recreated the sitmap xml file and resubmitted to google I was hoping google would forget the old url and start showing the new one. This was a few weeks ago and I'm still seeing old urls. Any idea how I can remove the old urls? Do I need to physically rename the page itself?
Please help.
Thanks
Since google has indexed old URLs, it will stay in their index unless you do something about it. There are two options you can handle.
If you want the old urls to coexist, you can do rel="canonical" on the old URL pages. Canonical will indicate that they are same pages with different urls.
Other option is doing 301 redirect. 301 indicates that the page has moved permanently and it helps search engines to carry over the SEO values of the old urls to the new ones. In due course search engines will index the new urls and old urls will go away. After a certain point in time, once you are sure that old URLs are not receiving any traffic, you can get rid of the redirect rule.

Keep old website (HTML files) on webserver but disallow search agents to index them

I’ve just finished a website for a client who is going to replace their old (very old, HTML hard-coded website). The problem is that they (for now) want to save their old website and all the files on the webserver in the original position. This does not create any issues with the new website which is made in PHP and Wordpress but it makes a big deal when Google (and others) are dropping by with their search robots and indexing.
When doing a Google search it still finds the old HTML files. Is there any way that I could “keep” the old HTML files on the web server but make sure that for the first no robots are going to index them and if anyone is trying to navigate to an HTML page, e.g. http://www.clientdomain.com/old_index_file.html, they are getting redirect? I think the last part might be able to be done in .htaccess but I haven’t found anything useful searching for it.
The first question about not allowing robots and agents to index HTML files, I’ve tried to put these two lines in my robots.txt file
Disallow: /*.html$
Disallow: /*.htm$
But I’m unsure if it will work?
I might deal with this in a completely wrong way but I’ve never tried that a client has requested to keep the old website on same server and in original location before.
Thanks,
- Mestika
<?php
$redirectlink = ‘http://www.puttheredirectedwebpageurlhere.com‘;
//do not edit below here
header (‘HTTP/1.1 301 Moved Permanently’);
header(‘Location: ‘.$redirectlink);
exit;
?>
This code will use a 301 redirect the page to the URL that you desire. The filename of this .php should be the URL slug of the page you want to redirect.
301 Redirect
A 301 redirect, or also known as a permanent redirect, should be put in place to permanently redirect a page. The word ‘permanent’ is there to imply that ALL qualities of the redirected page will be passed on to the detour page.
That includes:
PageRank
MozRank
Page Authority
Traffic Value
A 301 redirect is implemented if the change you want to make is, well… permanent. The detour page now embodies the redirected page as if it was the former. A complete takeover.
The old page will be removed from Google’s index and the new one will replace it.
Or you can do it in your htaccess like shown by the above poster.
There's probably a lot of ways to handle this, assuming you have a clear mapping of pages from the old template to the new one, you could detect the Google bot in your old template (see [1]) and do a 301 redirect (see [2] for example) to the new template.
List item
[1] how to detect search engine bots with php?
List item
[2] How to implement 303 redirect?
Will take some work, but sounds like you'll need to crack open your htaccess file and start adding 301 redirects from the old content to the new.
RewriteCond %{REQUEST_URI} ^/oldpage.html
RewriteRule . http://www.domainname.com/pathto/newcontentinwp/ [R=301,L]
Rinse and repeat
This is definitely something mod_rewrite can help with. Converting your posted robots.txt to a simple rewrite:
RewriteEngine on
RewriteRule /.*\.html /index\.php [R]
The [R] flag signifies an explicit redirect. I would recommend seeing http://httpd.apache.org/docs/2.4/rewrite/remapping.html for more information. You can also forbid direct access with the [F] flag.

I have changed my site from php to ASP? Now What to do with my Old URL's

Recently i have migrated my website from PHP (wordpress) to ASP. And now what to do with me old URL's as it got indexed in google and now showing 404 error. And i have migrated server also. Could some one help me in resolving the issue. Is it possible to redirect my old php url's to asp or is there any other way to do it. I have around 2500 url's.. Please help me out..
Yes it it possible to redirect your old php urls to your new asp.net urls.
You should check out the IIS Url Rewrite 2 plugin: http://learn.iis.net/page.aspx/737/url-rewrite-module-2/
You should set up rules, that result in a permanent redirect. In time google will crawl your old pages, get the permanent redirect response code and update its index.
There are 2 ways I can think of to achieve that -
If there is pattern - e.g. all URLs are in the format of scriptname.php?id=xxx
follow the instructions here at http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
OR
What you should do is set up a 404 page where you can check what request URL is. For example, if a request is made to an old url www.yourdomain.com/products.php?id=10 then show your 404 page where you'll check that if
//If URL == products.php
//Get ID of the product
//Redirect to products_new.asp?id=10 or whatever URL you require

maintain SEO of a website on platform change?

i have a site url
http://www.dualfocusphotography.co.uk
i want to convert it to word-press in such a way its SEO or site ranking should not be disturbed.
any one guide me is it possible if yes then how?
any help or relevant-materiel would be appreciated.
The main SEO issue when you try to move your site into wordpress is with the old indexed URLs by Google.
You must set "301 moved permanently status" to all of your old main urls.
You have to set an effective 404 page for error pages (WP had one).
Check for the main keywords through which people reached your site & retain those keywords. Generate new site map & submit in Google webmaster.
Migrate as quick as possible.
After migrating use WP SEO plugin & use keyword sparingly.
Use SEO friendly permalink structure.
Use twitter & facebook plugin's for socializing with virtual world.
Some useful links
https://seogadget.co.uk/surviving-seo-site-migration/
http://www.techwyse.com/blog/search-engine-optimization/5-tips-for-effective-seo-site-migration/
To keep your rankings, you should define what pages are the most important(have backlinks and are most visited and make sure you set redirects 301 on them.
There is a redirection plugin for wordpress to check for broken links. Doing redirect for all pages can affect the performance, that's why it is better to redirect the most important ones. This way you'll retain your rankings, however, a certain drop is unavoidable.
As long as you keep the same URLs, it won't matter if you are using from-scratch HTML pages or Wordpress. If you want to change the content around and will have new URLs, you'll need to do 301 redirects from each old page to each new page.
For example, the old page might have been oldsite.com/services.html, you'll do a 301 redirect to newsite.com/location/services
the 301 redirects are done in the .htaccess file.
I just wrote an article on how to SEO your wordpress site that might help you as well
Let me know if you need any help.
When migrating to a new CMS, try to keep your domain unchanged. If that's not possible, you should set up 301 permanent redirect to the following pages: homepage, most popular pages that get lots of traffic (check your analytics for them), pages with backlinks.
Also, when you change the URL structure, try to include your keywords
into the address
Check your robots.txt file - whether it;s indexing correctly
Generate the new xml sitemap and submit it via google webmaster
tools.
WordPress has it's own powerfll plugins for SEO. I suggest you use those.

Categories