Start Online Training

Get access to all our video classes and support. That's 1818 training sessions in Joomla, Drupal, WordPress, Coding and SEO.
Prices start only at only 25 USD per month

Testimonials

Testimonials OSTrainingOSTraining is amazing. I feel that always help is guaranteed. Simply like your service. Please convey to all your team"

~ Pradheep

 

Start a FREE 7 day trial! Get training videos and books, plus expert support:  

TOPIC: SEO Joomla Old Urls via new Urls

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45724

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
I Have just let out live a new yacht charter website created in joomla, but I have started facing a problem know:

the old website was "dot net nuke" so they had links like:
www.magnumnautica.com/croatia-yacht-char...charter-service.aspx

with the aspx url extension,

the new one is joomla and I use sh404 for SEO friendly URLS. So at the moment there is another link that is called:
www.magnumnautica.com/general-informatio...t-magnum-nautica.htm

I know to make 301 redirects inside the control panel on my hosting for that particular page, but there are many indexed pages that give a 404 page and they dont have a new similar page for now, so I would like to redirect them all to the home page? is that possible without going and finding links one by one?
Just to redirect all 404 pages to the homepage?

Thank you in advance

Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45753

  • edandrea
  • edandrea's Avatar
  • OFFLINE
  • Posts: 3094
  • Thank you received: 7
Hi Johnnie,

I don't know if you can do a wildcard redirect in cpanel. You might ask your host on that one.

If you're using sh404SEF It should list all the 404 errors so you don't have to go looking for them, but you'd still have to change them one at a time.

You might be able to do this with redirection in your htaccess file. Tessa's really good at htaccess redirects. I'll ask her to take a look at this.

Ed
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45761

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Hi Johnnie,


There are a few different ways to redirect your 404 pages to the homepage. Please make a backup of your site or files before making any changes.

1. With sh404SEF uninstalled, add this to .htaccess file:
ErrorDocument 404 index.php

2. With sh404SEF installed, go to templates/system/error.php and add this in your head tag:
<meta HTTP-EQUIV="REFRESH" content="0; url=/">


I'm assuming you will use #2, let me know your results.
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45813

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
I have tried nr.2 but no success?

this is still a 404:
www.magnumnautica.com/croatia-yacht-char...charter-service.aspx

any idea?
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45816

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Did you clear cache?
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45821

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
of course, I always do it :)
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45822

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Hi Johnnie,

You can try this method too in your error.php file:

Locate this code here:
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>

Change it to this:
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
if (($this->error->code) == '404') {
 echo file_get_contents('http://www.<your-url>.com');
} else {
?>

And add this code to the end of the document:
<?php } ?>

Here is documentation on how to do this: www.linkapps.com/joomla/12-handling404redirectioninjoomla.html

Let me know if this works for you. I have read this same method on another tutorial site and it has worked for some people.
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45823

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
I cant find exactly the same code, only this similar at the beginning of the document:
defined('_JEXEC') or die;
if (!isset($this->error)) {
	$this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
	$this->debug = false;
}

am I looking at the correct file?
public_html/templates/system/error.php ?
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45842

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Hi Johnnie,
if (($this->error->getCode()) == '404') {
header('Location: youraddress');
exit;
}

You can just put it right below defined('_JEXEC') or die;

Let me know if that works.
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45856

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
no, it doesnt work?
its weird, it says:
Not Found

The requested URL /croatia-yacht-charter/about-croatia-yacht-charter/about-our-charter-service.aspx was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

no matter what I do :(
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45916

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Did you put www.magnumnautica.com/index.php or something similar for your "Location"?
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45970

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
of course, just without the index.php...
now I have put it there (see screen attached) but nothing happens :-(
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45973

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Hi Johnnie,

Check out this tutorial first:
www.plethoracomputers.com/index.php/comp...d,5/func,view/id,79/
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45988

  • johnniek2
  • johnniek2's Avatar
  • OFFLINE
  • Posts: 575
  • Thank you received: 1
ok thanks
Please become a member of OSTraining to reply to this post.

SEO Joomla Old Urls via new Urls 1 year 11 months ago #45996

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Posts: 4073
  • Thank you received: 144
Hi Johnnie,

You are welcome. Let us know how that works for you.
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

 

Start a FREE 7 day trial! Get training videos and books, plus expert support: