替代
在Joomla!的index.php
或configuration.php
的頂部添加PHP Code
以下。
它檢查數值catid
& Itemid
請求&如果Itemid=435
會重定向URL與catid
&新Itemid
。隨意根據您的需要修改代碼!
if(isset($_GET['catid']) && is_numeric($_GET['catid']) && isset($_GET['Itemid']) && is_numeric($_GET['Itemid']))
if($_GET['Itemid'] == 435)
{
$catid = $_GET['catid'];
$location = "/index.php?option=com_adsmanager&view=list&catid=$catid&Itemid=565";
header ('HTTP/1.1 301 Moved Permanently');
header ('Location: '. $location);
}
答案 - 2
我假定你想要的是URI-1
重定向到URI-2
。
的index.php?選項= com_adsmanager &視圖=列表& CATID = 8 & ITEMID =
的index.php?選項= com_adsmanager &視圖=列表& CATID = 8 & ITEMID =
在mod_rewrite
以下會讓您將specific URI
重定向到其他specific URI
。 只需在.htaccess
文件中添加以下規則即可。
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^option=com_adsmanager&view=list&catid=8&Itemid=435$
RewriteRule ^/?index\.php$ /index.php?option=com_adsmanager&view=list&catid=8&Itemid=565 [R=301,L]
</IfModule>
答案 - 低於3
使用您.htaccess
,如果你要處理與'/index.php'
和'/'
請求。
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^option=com_adsmanager&view=list&catid=8&Itemid=435$
RewriteRule ^(.*)$ /index.php?option=com_adsmanager&view=list&catid=8&Itemid=565 [R=301,L]
</IfModule>
注意:不要在單一.htaccess
文件中使用兩個代碼。
另一種選擇是做 來源:myurl/index.php文件/變量 要:myurl/index.php文件/ clasificados /可變 –