Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 从运行TYPO3的服务器上的重写引擎中排除某些目录_.htaccess_Mod Rewrite_Typo3 - Fatal编程技术网

.htaccess 从运行TYPO3的服务器上的重写引擎中排除某些目录

.htaccess 从运行TYPO3的服务器上的重写引擎中排除某些目录,.htaccess,mod-rewrite,typo3,.htaccess,Mod Rewrite,Typo3,我想为目前正在服务器上运行TYPO3网站的客户开发一个新网站 我想从TYPO3重写引擎(realurl?)中排除一个子目录,这样我就可以正常访问该子目录 www.domain.com/dev 比如说 我有权访问该站点,但只要我将.htaccess文件放在某个目录中,用htpasswd保护它。我得到一个输入错误3: 原因:段“dev”不是postVarSet的关键字 在.htaccess中找到这个 # Stop rewrite processing, if we are in the typo3/

我想为目前正在服务器上运行TYPO3网站的客户开发一个新网站

我想从TYPO3重写引擎(realurl?)中排除一个子目录,这样我就可以正常访问该子目录

www.domain.com/dev

比如说

我有权访问该站点,但只要我将.htaccess文件放在某个目录中,用htpasswd保护它。我得到一个输入错误3:

原因:段“dev”不是postVarSet的关键字

在.htaccess中找到这个

# Stop rewrite processing, if we are in the typo3/ directory or any other known directory
# NOTE: Add your additional local storages here
RewriteRule (?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
并在那里添加您的目录

# Stop rewrite processing, if we are in the typo3/ directory or any other known directory
# NOTE: Add your additional local storages here
RewriteRule (?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico|dev/) - [L]

我找到了解决办法,但一点也不简单

我需要将此行添加到受保护子目录中的.htaccess中:

ErrorDocument 401 "Not authorized"

显然,URL重写和基本身份验证之间存在冲突,就像我的情况一样。服务器写入“401 Unauthorized”头,并根据预定义的路径查找现有错误文档,然后将其重写

我尝试了这个,不幸的是,当我将这个.htaccess添加到dev目录中时,它仍然无法工作:AuthType Basic AuthName“Password Protected Area”AuthUserFile.htpasswd需要没有这个的有效用户。htaccess它工作得很好。您必须将这个.htaccess规则放在web根目录中。