Apache2 位置指令和 mod_rewrite

Apache2 位置指令和 mod_rewrite

我有一個受基本驗證保護的網站,除了一個文件、一個資料夾和一個重寫的 URL 位置之外。

它看起來像這樣:


<Directory /var/www/mydomain.com>
  AuthType Basic
  AuthName "Authentication Required"
  AuthUserFile "/etc/htpasswd.mydomain"
  Require valid-user
  Options Indexes  FollowSymLinks
  AllowOverride All
</Directory>

<Location /manifest.webmanifest>
  Satisfy Any
  Allow from all
</Location>

<Location /icons/>
  Satisfy Any
  Allow from all
</Location>

<Location /receive>
  Satisfy Any
  Allow from all
</Location>

manifest.webmanifest並且/icons/資料夾中的文件繞過了身份驗證,但/receive沒有。明顯的區別是這receive不是一個實際的檔案 - 它被重寫為 /index.php 進行渲染。

如何讓它繞過 /receive 的身份驗證?

編輯:重寫發生在 .htaccess 檔案中:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteRule ^(.*)$ index.php?AppRouting=$1 [QSA]

相關內容