【发布时间】:2020-04-17 05:30:44
【问题描述】:
我有一些目录:
/
/dash
/something
我想让 htaccess 将所有流量重定向到它的子文件夹 index.php ,我这样做了,当我输入它时 example.com/dash 或 example.com/something
但我的问题是当我尝试类似 example.com/dash/login 或 example.com/dash/another 在这种情况下,我被重定向到 / 目录
这是我在 / 目录中的 htaccess
https://we.tl/t-NtTDlYKBHr
Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?!dash/)(.+)$ /index.php?u=$1 [NC,QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^dash/(.+)$ /dash/index.php?u=$1 [NC,QSA,L]
在 /dash
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]
https://we.tl/t-lhgQ03tTGE
【问题讨论】:
标签: php apache .htaccess xampp