1

我想要达到的目标:

  • alias/index.php?"anything here" 一直有效
  • 别名/“任何目录”/index.php 重定向到别名/index.php
  • “任何 file.php” 重定向到 alias/index.php
  • alias/"any directory"/"any file.php" 重定向到 alias/index.php

只希望能够从别名目录的根目录执行 index.php

试过:

RewriteCond %{REQUEST_FILENAME} !index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://<host>:<port>/<alias>/index.php [NC,R,L]

这不会将任何子目录中的 index.php 重定向到 alias/index.php

4

0 回答 0