Recently I had to migrate an old Joomla website to DNN. Because there are not so many pages inside, I decided to convert the pages manually and everything was fine. But what should I do with all the links to the old Joomla website out there in the wild ? The site is running for nearly 8 years now and there are a lot of links. Forgetting about that and loosing all the page ranks is a no go for this website. Fortunately I found an easy solution for this :
I found a blog entry from Bruce Chapman (ifinity URL Master) who is dealing with this, but using URL Master was in this case no option for me.
My first try was to use the internal URL Rewriting possibilities in DNN. Everything in Joomla is routed through “index.php” (similar to DNN “Default.aspx”), so my first attempt was Copying default.aspx to index.php, create a handler in IIS for .php similar to .aspx, include** index.php** in IIS standard docs to achieve that DNN gets the requests to all the old Joomla links. Next I tried to add some Friendly Url rewriting rules in the host settings of DNN. Result was: Does not work!
I had to rethink my solution. First I reverted all my dirty tricks (that also destabilized my system). Perhaps it would be easier to let DNN how it is and handle all this with the original programming language of joomla: PHP ! The only backdraw is that I have to install PHP on my webserver but the footprint is really small so I checked out this solution. And after fondling 2 hours with my new index.php that I placed in the DNN root folder, everything works like a charm!
So this is my index.php:
<?php
header("HTTP/1.1 301 Moved Permanently");
$option = $_GET['option'];
if ($option == "com_content" || $option == "content")
{
$id = $_GET['id'];
$item = $_GET['Itemid'];
if ($id == "82") { header("Location: http://www.auktionsbuddy.de/ShopBestellen");}
else if ($id == "71") { header("Location: http://www.auktionsbuddy.de/Auktionsbuddy.aspx");}
else if ($id == "72") { header("Location: http://www.auktionsbuddy.de/Auktionsbuddy/Auktionenerfassen.aspx");}
else if ($id == "73") { header("Location: http://www.auktionsbuddy.de/Auktionsbuddy/ControlCenter.aspx");}
else if ($id == "74") { header("Location: http://www.auktionsbuddy.de/Auktionsbuddy/Mailbox.aspx");}
else if ($id == "75") { header("Location: http://www.auktionsbuddy.de/Auktionsbuddy/Rechnungen.aspx");}
... all the other content redirects ...
else { header("Location: http://www.auktionsbuddy.de/Default.aspx");}
}
else if ($option == "com_regbuddy")
{
header("Location: http://www.auktionsbuddy.de/BoxRegistrierung.aspx");
}
else if ($option == "com_remository")
{
header("Location: http://www.auktionsbuddy.de/Downloads.aspx");
}
else if ($option == "com_registration")
{
header("Location: http://www.auktionsbuddy.de/Login.aspx");
}
else if ($option == "com_easyfaq")
{
header("Location: http://www.auktionsbuddy.de/FAQs.aspx");
}
else if ($option == "com_virtuemart")
{
$category = $_GET('category_id');
if ($category == "30") { header("Location: http://www.auktionsbuddy.de/Artikelliste/tabid/139/productgroup/6/Default.aspx");}
if ($category == "29") { header("Location: http://www.auktionsbuddy.de/Artikelliste/tabid/139/productgroup/4/Default.aspx");}
... all the other shop categories ...
else { header("Location: http://www.auktionsbuddy.de/ShopBestellen");}
}
else
{
header("Location: http://www.auktionsbuddy.de/Default.aspx");
}
exit;
?>
This could by easy adopted for other php cms systems and does not harm your DNN system. Hope this helps someone who faces the same problem one day.