htaccess https://example.com/dash/something link 重定向问题

htaccess https://example.com/dash/something link redirect problem

我有一些目录:

/
/dash
/something

我想让 htaccess 将所有流量重定向到它的子文件夹 index.php ,我这样做了,当我输入它时它工作 示例.com/dash 或示例.com/something

但我的问题是当我尝试类似这个例子的时候。com/dash/login 或 example.com/dash/another 在这种情况下,我被重定向到 / 目录

这是我在 / 目录下的 htaccess

https://我们.tl/t-NtTDlYKBHr

Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?!dash/)(.+)$ /index.php?u= [NC,QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^dash/(.+)$ /dash/index.php?u= [NC,QSA,L]

并在 /dash

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path= [NC,L,QSA]

https://我们.tl/t-lhgQ03tTGE

我不是这方面的专家。但我认为你可以通过这样的方式实现它。
把这个文件放在你的父目录中

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^none/ none/index.php [NC,L,QSA]
RewriteRule ^dash/ dash/index.php [NC,L,QSA]
RewriteRule ^something/ something/index.php [NC,L,QSA]
RewriteRule ^ index.php [NC,L,QSA]

另外,如果您将 htaccess 放在每个目录中,您可以在所有目录中使用它。

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [NC,L,QSA]