Manual:$wgActionPaths/zh

详情
若要为普通页面视图以外的操作设置“Pretty”URL路径，请添加到此数组中. 例如：

除了设置此变量外，还必须设置适当的脚本或服务器重写规则来处理这些URL.



示例配置
这些示例包括使用mod_rewrite的Apache服务器的示例.htaccess文件. 其他服务器将有其他方法来完成URL重写.



从根开始的操作路径
这将设置 等形式的操作路径.


 * LocalSettings.php



额外的HTAccess规则

 * .htaccess
 * 务必将“/w/index.php”修改为安装MediaWiki的位置



在最后的动作
这将设置 等形式的操作路径.



非根操作路径
对于标准的Example.com/wiki/Main_Page重写为Example.com/wiki/view/Main_Page，请使用上面的配置并更改此行以包括“/wiki”：

用于标准的Example.com/wiki/Main_Page视图URL，并重写为Example.com/Wiki/EDIT/Main_Page



最后的配置
For standard example.com/wiki/Main_Page view urls, and rewrites to example.com/wiki/Main_Page/edit

Virtual action / directories
This sets up URLs such as  etc.

To rewrite most actions to a specific path, one could make the following changes to :

In Apache, code a rewrite rule similar to the following:

This will forward all requests to /action/actionword/title to MediaWiki's index.php which will parse the action and title according to your $wgActionPaths settings.

When configuring Apache mod_negotation to execute PHP scripts when using this method care should be taken not to cause 406 Not Acceptable errors that might in some cases expose a directory listing, see,. 参见21617.

Spam prevention
Using $wgActionPaths, especially for the edit action seems to reduce the number of spam bots attempting article edits. It is suspected that bots are programmed to look for action=edit to identify a MediaWiki installation and act appropriately. With this in mind, it would be beneficial to name your action prefix something non-apparent so bots can't find your site when they start looking for action/edit.