我正在创建一个API类型的插件,它从easysocial获取活动流。但是我在活动流中获得了SEF URL,我想要非SEF URL,以防在Joomla配置中打开SEF。
请告诉我如何才能以编程方式做到这一点。
我试图覆盖我的插件中的Joomla配置设置,但它不会像下面给出的那样工作。
$config = JFactory::getConfig();
$sef = $config->set('sef', 0);发布于 2015-06-25 21:55:44
为此,您需要创建一个特殊的.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。
我还没有证实这一点。如果它不起作用,请告诉我。
https://stackoverflow.com/questions/31049266
复制相似问题