如何在单个视图中将Joomla中的SEF URL更改为非SEF URL?

时间:2015-06-25 11:36:54

标签: php joomla sef

我正在创建一个API类型插件,它从easysocial获取活动流。 但是我在活动流中获得了SEF URL,如果在Joomla配置中启用了SEF,我想要NON-SEF URL。

请告诉我如何以编程方式执行此操作。

我试图在我的插件中覆盖Joomla配置设置,但它不会如下所示。

$config = JFactory::getConfig();
$sef = $config->set('sef', 0);

1 个答案:

答案 0 :(得分:0)

您需要为该

制定一个特殊的.htaccess规则

找到这个部分:

RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]

并在其上方添加以下行:

RewriteCond %{REQUEST_URI} !^/index\.php?option=com_something&var=something

如果您将URL更改为nonSEF url,则不需要解析。

我还没有证实这一点。如果它不起作用,请告诉我。