将root重定向到子目录,然后将其从url

时间:2019-03-08 09:31:33

标签: apache .htaccess mod-rewrite url-rewriting

我将根URL(example.com)重定向到其子目录(example.com/subdir),现在我想从URL中删除子目录名称,如下所示:

我想要

example.com/subdir

要重写为

example.com

,前提是其他文件和子目录不会被重写。 当前的根htaccess是这个(wordpress规则):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

编辑

对于重定向,我使用了yoast seo插件工具,但可以将其更改为其他方法。

0 个答案:

没有答案
相关问题