2012-03-20 8 views
0

私は与えられたURLを傍受し、特定のページを提供するパラメータに依存することを可能にするコードスニペットが大好きです。バイパスjoomlaのメニューシステム

目的は、URLの最後の部分が '/ blah'と言っていたとしても、私が望むページを表示するということです。

ex 1: http://website/index.php/blah/ 
ex 2: http://website/index.php/blogcategory/articlex/blah/ 
ex 3: http://website/index.php/blogcategory/article5/blah/ 

すべて同じ記事を表示しますか?

おかげで、

マット

+0

http://docs.joomla.org/Plugin/Events/System#onAfterInitialise

あなたが機能するために必要なコードのようなもの(テストしていない)だろう ます。http:// stackoverflowの.com/questions/5010208/htaccess-redirect-permanent-www-domain-com-a-to-www-domain-com-ab – Shaz

答えて

0

あなたがトリガされたプラグインを必要とする 'onAfterInitialise'。見て:これはあなたを助けることができる

/** 
* Do something onAfterInitialise 
*/ 
function onAfterInitialise() 
{ 
    // check for occurrence of string in url 
    $findme = 'blah'; 
    $myuri = JRequest::getURI(); 
    $tocheck = strpos($myuri, $findme); 

    if ($tocheck === true) { 
     $app = JFactory::getApplication(); 
     $app->redirect('/anywhereyouwant'); 
    } 
} 
+0

次の週にこれを試してみてください –

関連する問題