linux - .htaccess - 从 RewriteCond 中排除目录

标签 linux .htaccess

我尝试了很多规则,并进行了很好的搜索,以将目录从以下规则中排除,但徒劳无功:

RewriteCond %{REQUEST_FILENAME} !-d

目前,这在我的网络应用程序中运行得很好,但我现在只需要排除一个名为“vendors”的文件夹

最佳答案

您可以使用:

RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/vendors/?$ [NC]

这正是您所要求的。

关于linux - .htaccess - 从 RewriteCond 中排除目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33934748/

相关文章:

.htaccess - .htaccess 中的 AuthName 未显示在 Chrome 中

php - 地址栏位置的 Apache 重写规则

php - WAMP .htaccess 在从 XAMPP 移动后出现内部服务器错误

Java 的 g.drawImage 在 Windows 上比 Linux 上花费的时间明显更长

python - 如何在centos中通过python将doc更改为txt

linux - Linux服务器的交互式网站

linux - 如何压缩目录中大于一定大小的文件?

apache - 使用htaccess在Xampp上出现错误500(密码)

.htaccess - Mod_rewrite 有效但路径已更改

php - 在 var/www/image 目录中启用写入权限 Ubuntu Server