将 root index.php 重定向到子目录

Redirect root index.php to subdirectory

我已经将 wordpress 安装到一个文件夹中,我想在不使用

的情况下将 root index.php 重定向到 wordpress 文件夹

header('Location: ./folder/');

或元重定向。 我只想使用 .htaccess 规则重定向索引文件。我该怎么做?

编辑

我表达得很糟糕,我需要一种重定向,但不是真正的重定向,因为使用重定向会导致 Google 出现一些问题。 所以我想给 ./folder/ 而不是 index.php./.

使用这个重定向

重定向 301 /index.php /sub/index.php

你的 htaccess 应该看起来像这样

# BEGIN WordPress
<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

只需更换

RewriteBase /

RewriteBase /foldername