从WordPress删除尾随斜杠

时间:2020-02-18 18:09:38

标签: wordpress .htaccess

我的网站地址是

https://lofty-tibiabot.com/new/ 该网站在子文件夹中-新

我希望地址为

https://lofty-tibiabot.com/new

  # BEGIN WordPress
    # The directives (lines) between `BEGIN WordPress` and `END WordPress` are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /new/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /new/index.php [L]
    </IfModule>
    # END WordPress

做什么?

1 个答案:

答案 0 :(得分:0)

确定吗?

这有点混乱,因为Apache 需要目录中的尾斜杠才能评估DirectoryIndex等。通过禁用尾斜杠,我们必须使用以下方法手动处理这种情况mod_rewrite。

尝试以下操作:

1) /new/.htaccess的根目录中。这将/.htaccess从WordPress中删除,因此WP无法再维护此文件(不一定是一件坏事)。

2).htaccess文件更改为:

/.htaccess