【问题标题】:.htaccess RewriteRule for joomla k2joomla k2 的 .htaccess 重写规则
【发布时间】:2012-05-30 17:01:32
【问题描述】:

我正在使用主 .htaccess http://joomla-master-htaccess.googlecode.com/svn-history/r40/trunk/joomla-master-htaccess.txt

我正在尝试为我的 k2 模块设置 RewriteRule 以添加项目,firebug Net 面板将我指向 http://www.wyzed.net/component/k2/item/add?tmpl=component,它返回 Not Found 404 错误

item/add?tmpl=component

这个我试过了

重写规则 ^components/com_k2.php$ - [L]

重写规则 ^modules/mod_k2_content/tmpl/Default.php$ - [L]

重写规则 ^modules/mod_k2_content.php$ - [L]

重写规则 ^components/com_k2/controllers.php$ - [L]

仍然没有成功我想知道是否有人使用 joomla 和 k2 与 master .htaccess add 弄清楚如何向 k2 模块添加例外规则

【问题讨论】:

  • 基本上每个 K2 函数都可以工作,除了前端的添加项

标签: .htaccess mod-rewrite joomla


【解决方案1】:

我想我会写我自己的答案... 在 htaccess 中有一个名为(高级服务器保护)的部分

要使用带有 master .htaccess 的 K2 扩展删除这些行

## Disallow visual fingerprinting of Joomla! sites (module position dump)
## Initial idea by Brian Teeman and Ken Crowder, see:
## http://www.slideshare.net/brianteeman/hidden-joomla-secrets
## Improved by @nikosdion to work more efficiently and handle template
## and tmpl query parameters
RewriteCond %{QUERY_STRING} (^|&)tmpl=(component|system) [NC]
RewriteRule .* - [L]
RewriteCond %{QUERY_STRING} (^|&)t(p|emplate|mpl)= [NC]
RewriteRule .* - [F]

还有这个部分

## Referrer filtering for common media files. Replace with your own domain name.

用这个替换最后一行

RewriteRule \.(jp(e?g|2)?|png|gif|bmp|js|swf|ico)$ - [F]

允许从 k2 加载 css..

享受吧。

【讨论】:

    猜你喜欢
    • 2018-12-08
    • 1970-01-01
    • 2017-01-01
    • 2011-01-14
    • 1970-01-01
    • 2011-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多