我怎樣才能做到以下可能.htaccess?限制子目錄登錄用戶
/sp/sitea => /check.php?page=sitea #no trailing forward slash
/sp/sitea/ => /check.php?page=sitea #trailing forward slash
/sp/sitea/index.php => /check.php?page=sitea/index.php #includes a file
/sp/siteb => /check.php?page=siteb
/sp/index.php , /sp/login.php => no redirect
然後我想用PHP的站點A,看看用戶是否登錄,然後重定向到/ SP /站點A如果他們還沒有登錄該站點重定向到/login.php
檢查DB我試過的.htaccess下面,在SP文件夾,但犯規重定向,我不是真正的.htaccess主
RewriteEngine On
RewriteCond %{REQUEST_URI}/
RewriteRule ^\/(.*)$ sp/check.php?path=$1 [L]
你是什麼意思 「但不工作」? –
@MatthewCliatt它不重定向 – tsukimi
你想在你的文章中包含這些信息。 –