编辑WP htaccess控件

时间:2015-07-29 04:25:05

标签: wordpress .htaccess plugins

我目前正在为我的WordPress网站使用WP htaccess Control插件,我想对其代码进行修改。目前,每个页面都可以通过多个url结构访问。例如,site.com/page/可以通过site.com/page

访问

我想设置htaccess,而非尾部斜杠重定向到尾部斜杠,用于网站的每个页面。

我相信我有代码,但我已经看到了几个不同的变体。我想确保我实现正确的,并且我不确定应该如何使用这个特定的插件。

我是否只需将其他行添加到" custom"部分?根据我的理解,它必须与重写规则一起放置,但我可以输入的自定义代码只能到顶部。

目前,以下行是"自定义htaccess":

php_value memory_limit 96M

整个文件是:

# BEGIN WordPress

# WPhtc: Begin Custom htaccess
php_value memory_limit 96M
# WPhtc: End Custom htaccess

# WPhtC: Disable ServerSignature on generated error pages
ServerSignature Off

# WPhtC: Protect WP-config.php
<files wp-config.php>
order allow,deny
deny from all
</files>

# WPhtC: Protect .htaccess file
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
</files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

谢谢

0 个答案:

没有答案