如何捕捉URL作为变量和Apache配置文件中使用它 [英] how to capture URL as a variable and use it in the apache configuration file
问题描述
我想知道如何设置变量在CentOS的Apache配置
用户会登录:www.example.com/$1($ 1是一个变量) 服务器名本地主机
的ServerAdmin webmaster@example.org
的DocumentRoot的/ var / www / html等
I would like to know how to set variable in centos apache config The user will login as: www.example.com/$1 ($1 is a variable) ServerName localhost ServerAdmin webmaster@example.org DocumentRoot /var/www/html
别名/ $ 1 /家庭/客户/ $ 1选择了FollowSymLinks索引
DAV在
所有的AllowOverride
AuthType选项基本
AuthName指令hellow
的AuthUserFile /etc/httpd/$1.password
需要有效的用户
Alias /$1 /home/client/$1 Options Indexes FollowSymLinks DAV On AllowOverRide All AuthType Basic AuthName hellow AuthUserFile /etc/httpd/$1.password Require valid-user
我如何使这个1 $工作
How do I make this $1 to work
推荐答案
DAVMinTimeout 180
服务器名本地主机
SERVERADMIN webmaster@example.org
DAVMinTimeout 180 ServerName localhost ServerAdmin webmaster@example.org
的DocumentRoot的/ var / www / html等
DocumentRoot /var/www/html
别名/测试1 /家庭/客户/ TEST1选择了FollowSymLinks索引
DAV在
所有的AllowOverride
AuthType选项基本
AuthName指令Xfficient-TEST1
的AuthUserFile /etc/httpd/webDAV/test1.password
需要有效的用户
Alias /test1 /home/client/test1 Options Indexes FollowSymLinks DAV On AllowOverRide All AuthType Basic AuthName Xfficient-test1 AuthUserFile /etc/httpd/webDAV/test1.password Require valid-user
这篇关于如何捕捉URL作为变量和Apache配置文件中使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!