I've since moved my main site from php-nuke to SMF and looking to better redirect old URL's if possible, and I'm having trouble working out rewriteCond and rewriteRule to perform what I want to do.
For the first two URL's want to take the ID numbers and pass them to the target URL.
So I want to redirect this URL:
modules.php?name=Forums&file=viewtopic&t=6825
To:
index.php?topic=6825
Also from:
modules.php?name=Forums&file=profile&mode=viewprofile&u=232
To:
index.php?action=profile;u=232
Then want to capture any left over URL's that start with
modules.php
and redirect to base
index.php
of my main URL.
Any times and assistance would be appreciated.
not an .htaccess solution, but a solution ;)
<?php
//check ID_TOPIC
if (isset($_REQUEST['t']))
{
$newurl = 'Location: index.php?topic='.$_REQUEST['t'];
header('HTTP/1.1 301 Moved Permanently');
header($newurl);
header('Connection: close');
}
//check ID_MEMBER
elseif (isset($_REQUEST['u']))
{
$newurl = 'Location: index.php?action=profile;u='.$_REQUEST['u'];
header('HTTP/1.1 301 Moved Permanently');
header($newurl);
header('Connection: close');
}
//Redirecht to index.php
else
{
$newurl = 'Location: index.php';
header('HTTP/1.1 301 Moved Permanently');
header($newurl);
header('Connection: close');
}
?>
Sweet thx TE, any solution that works ... will work for me. I'll test it out and see how it goes.
EDIT: Tested, and it works PERFECTLY! and I'll be able to add to that as well if needed.
Thank you!
great solution, thank you!