Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

Redirecting non-sef URLs
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: Redirecting non-sef URLs

Redirecting non-sef URLs 15 years, 10 months ago #5615

Hello

I'm using the latest version of JomSef on my website Proxy.
Now I'm trying to redirect an old URL:

index.php?option=com_wrapper&ltemid=8

should redirect to

/Proxy/Proxyliste.html

But this don`t works. It always creates an new SEO Url.
Is there any way to do it with JoomSEF?

Thanks

Re:Redirecting non-sef URLs 15 years, 10 months ago #5616

I programmed a workaround:

$query = "SELECT id, old, new"
. "\n FROM jos_sefmoved"
. "\n WHERE old = '".substr($_SERVER['REQUEST_URI'], 1)."'";
$database->setQuery( $query);
 
if($database->loadResult()){
$redirect = $database->loadObjectList();
$redirect = $redirect[0];
 
$query = "update `jos_sefmoved` set `lastHit` = NOW() where id = ".$redirect->id;
$database->setQuery( $query);
$database->query();
 
$new = "http://".$_SERVER['SERVER_NAME']."/".$redirect->new;
 
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$new);
exit();
}


This works with any file and parameters.
I placed it under:
// displays offline/maintanance page or bar
if ($mosConfig_offline == 1) {
require( $mosConfig_absolute_path .'/offline.php' );
}


Works fine I think.
  • Page:
  • 1
Přihlášení uživatele Prázdný