在Wordpress的子文件夹中提交论坛404错误

时间:2015-04-20 14:01:50

标签: wordpress forms submit http-status-code-404 subdirectory

我有一个问题,表单在提交时会抛出404错误,但只有当某些字词在帖子正文中时才会出现。

这是我的表格。

<form role="form"  action="edit-training-page.php?id=<?php echo $training_id; ?>" method="post" onSubmit="return confirm('Confirm Updating Training Page?');">
            <div class="form-group fl w300 mr">
                <label>Training Name</label>
                <input name="training_title" type="text" class="form-control"  placeholder="" required value="<?php echo $training_title ; ?>">
            </div>
            <div class="form-group fl w200 mr">
                <label>Short URL</label>
                <input name="training_url" type="text" class="form-control"  placeholder="" required value="<?php echo $training_url ; ?>">
            </div>
            <div class="form-group fl w100 mr">
                <label>Sort Order</label>
                <input name="training_order" type="text" class="form-control"  placeholder="" required value="<?php echo $training_order ; ?>">
            </div>
            <div class="form-group fl mr" style="width:100%;">
            <textarea name="traininfo" rows="20" cols="80" /><?php echo $traininfo ; ?></textarea>
            </div>
            <div class="clear mt " >
            <input type="hidden" name="training_id" value="<?php echo $training_id; ?>" />
            <button type="submit" name="update" class="btn btn-success fl mr"><i class="glyphicon glyphicon-edit"></i> Update Training Page</button>


        </form>

我们在WordPress中有一个子文件夹,用于与WordPress无关的仪表板系统。这是所有PHP驱动的脚本。它位于服务器根目录下的文件夹中,此表单用于添加培训内容。我一直在将培训文档从其他位置迁移到这个新系统中。即使URL正确,它也会在提交时随机抛出404。例如,今天如果&#34;来自&#34;在textarea字段中,它会在提交时提供wordpress 404错误屏幕。我已经检查了WordPress中保留的WordPress列表,并且没有任何输入字段是保留的名称。

我尝试通过编辑.htaccess文件并将行更改为来排除文件夹 RewriteRule ./ / index.php [L] - 没有变化。

处理表单的php代码在同一页面上。

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

这对WordPress来说并不是一个问题。这很可能是由于在Apache中包含和配置mod_security。因此,您可能需要修改配置,或者如果可以的话,只需摆脱该特定模块。

在.htaccess中尝试将其关闭:

对于mod_security:

# Turn off mod_security filtering.
<IfModule mod_security.c>
  SecFilterEngine Off
</IfModule>

对于mod_security2:

# Turn off mod_security filtering.
<IfModule mod_security2.c>
  SecRuleEngine Off
</IfModule

但请注意,Apache可能已配置为不允许在.htaccess中将其关闭。

相关问题