5
I got this to work
Create a folder in your root and name it "users":
Create a .htaccess file under the "users" folder and paste this lines:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(^/users/)(.*)$
RewriteRule ^([^link].*)$
https://xoops.org/users/?link=%2 [R,QSA,L]
Were "www.xoops.org" should be changed to fit your site
Create now a index.php file under the "users" folder and paste this lines:
include("../mainfile.php");
isset($_GET['link'])? $uname = $_GET['link'] : $uname = '';
if ($uname != ''){
$sql= sprintf("SELECT uid FROM %s WHERE (uname = '%s')",$xoopsDB->prefix("users"), $uname);
$result = $xoopsDB->queryF($sql);
list($uid) = $xoopsDB->fetchRow($result);
if ($uid > '0'){
$redirect_to = XOOPS_URL.'/userinfo.php?uid='.$uid;
} else {
$redirect_to = XOOPS_URL.'/index.php';
}
} else {
$redirect_to = XOOPS_URL.'/index.php';
}
header('location: '.$redirect_to);
?>
I'd like to be able to just put code into htaccess instead of having to use a users folder any sugestions
Musicians for musicians entertaining the world, what starts as a dream can live in reality!