我有一个域,mattpotts.com
并设置了一个子域dev.mattpotts.com
供我开发,然后在准备好时将文件复制到正常域。
我的目录结构如下并dev.mattpotts.com
指向dev/
+-public_html/ +-项目1/ +-项目2/ +-项目3/ +-开发/ +-项目1 +-项目2 +-项目3
我基本上希望能够http://mattpotts.com/project1
通过https://dev.mattpotts.com/project1
添加dev.
.
.htaccess
我有以下内容dev/
并且它可以工作,所有这需要做的就是强制 https。
重写引擎开启 RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} dev 重写规则 ^(.*)$ https://dev.mattpotts.com$1 [R,L]
我想强制使用 https,以便我可以在目录上安全地使用 http auth。但是,当我将它与以下规则结合使用时,它不起作用。我已经.htpasswd
设置好了,但我什至还没有显示登录表单。
AuthType 基本 AuthName "开发保护区" AuthUserFile .htpasswd 需要有效用户
如何成功地组合 .htaccess
规则集?
编辑,非常奇怪的事情正在发生!
https://dev.mattpotts.com/project1/显示“你好!” 从网站的非开发版本(注意 https) http://dev.mattpotts.com/project1/显示“hello dev!” (根据需要)来自开发版本。这里发生了什么?!