1

我想将一个文件夹的所有无文件和无目录重定向到另一个文件夹。.htaccess 应该在 root ( http://example.com ) 上。

例子:

http://example.com/admin/core/file.php - Does not exists. So, redirect (internally) to http://example.com/adminhide/core/file.php

http://example.com/admin/index.php - Exists. So, don't do anything..

我尝试创建代码,但出现 500 内部服务器错误:

Options +FollowSymLinks

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/admin/$
RewriteRule (.*)$ /adminhide/$1 [L]
4

0 回答 0