有没有办法取回重写条件的引用传递给所有后续的重写规则? 这是一个例子: RewriteEngine On RewriteCond %{HTTP_HOST} (bob).localhost [NC] RewriteRule ^/where/? /index.php\?user_name=%1 RewriteRule ^/who/? /index.php\?user_name=%1 在这个例子中,我期望这个行为: http://bob.localhost/where => http://bob.localhost/where/index.php?user_name=bob http://bob.localhost/who => http://bob.localhost/who/index.php?usern_ame=bob 但是对于第二条规则,我接收http://bob.localhost/who/index.php?user_name = 。 我已经尝试了几个不同的发行版使用Apache 2.2.17
我是新手的问题: 我怎样才能设置error.log文件和所有各种日志保持只有几天的日志? 我的文件现在巨大! 我不能保持20GB的日志! 我看到和增加的磁盘空间,如在5天的forms30%至110%…也许我有一个正在运行的进程,创build一个背景错误? 在任何情况下它是pobbisle限制这些文件的大小?? 你如何访问这些日志? 我的意思是你只是使用terminal阅读他们? 通过webmin?
我在我的apache错误日志文件中得到这些错误: [Fri May 20 16:17:06 2011] [notice] Apache/2.2.17 (Ubuntu) PHP/5.3.5-1ubuntu7.2 with Suhosin-Patch configured — resuming normal operations [Fri May 20 16:17:11 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration [Fri May 20 16:17:12 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps […]
这是一个愚蠢的问题,但有没有Apache的.htaccess文件格式的语法规范? 我所能find的只是“教程”,这不是我想要的。 我想要的是一个.htaccess文件中将被识别的所有有效关键字的列表以及所有有效的参数和函数。 这是否存在?
这是我目前的设置: 在httpd.conf的底部,我有以下几点: NameVirtualHost *:80 Include /etc/httpd/conf/vhosts/* 在/etc/httpd/conf/vhosts我有以下文件: mainsite.com.conf: <VirtualHost *:80> DocumentRoot "/var/www/vhosts/mainsite.com" ServerName mainsite.com ServerAlias www.mainsite.com <Directory "/var/www/vhosts/mainsite.com"> allow from all Options -Indexes </Directory> </VirtualHost> sub1.mainsite.com.conf: <VirtualHost *:80> DocumentRoot /var/www/vhosts/sub1.mainsite.com ServerName sub1.mainsite.com <Directory "/var/www/vhosts/sub1.mainsite.com"> allow from all Options -Indexes </Directory> </VirtualHost> 到现在为止还挺好! mainsite.com和www.mainsite.com共享相同的DocumentRoot (稍后我可以将所有的www.mainsite.com用户redirect到mainsite.comsearch引擎优化)。 sub1.mainsite.com也有自己的DocumentRoot ,不会干扰其他任何事情。 但是, <Anything that isn't www or sub1>.mainsite.com获得与<Anything that isn't […]
我在mycompany.tld1上有一个现有的Wordpress站点设置,最近注册了mycompany.tld2。 我想设置从mycompany.tld2到mycompany.tld1的301redirect,那个.htaccess文件是什么样的? 我可以使用条件语句将它附加到Wordpress .htaccess文件中以检查入站URL吗? WP .htaccess(现有): <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
我想configurationApache直接从文件系统提供文件,但是validation/授权用户。 Apache如何configuration,所以它调用我的authentication中间件? 基本上: 1)如果用户未通过身份validation,则redirect到login。 否则检查会话cookie数据库。 2)允许根据用户是谁(授权)访问某些文件。
我没有上传index.html或index.php到我的根目录。 如何防止人们查看父目录中的文件列表? 另外,一旦我上传index.html,人们有可能获得根目录中所有文件的列表吗? 我正在使用.htaccess和htusers来提示某人在尝试访问根目录中的任何文件时input用户名和密码。 这可能听起来像一个奇怪的请求,但它有可能让他们来到网站(没有index.html),只是让他们看不到的文件? 所有它会在页面上说的是: 指数/ Apache服务器在mysite.com端口80
我正在寻找的是根据他们的语言select引导访问者在地理上分开的服务器。 我们的url结构像mydomain.com/en和mydomain.com/th (泰文)。 就像现在一切托pipe在同一台服务器上一样。 但是,对于select第五种语言的访问者,我们最好从位于泰国境内的服务器提供服务。 泰国访客的网页加载速度显着提高。 我的平台是Apache,Linux,MySQL – 常规的LAMP堆栈。 那么…是否有可能以这种方式configurationApache,以便按照上面所述的方式redirect所有stream量? 请记住,域名不能改变,我们也不能使用子域名。 它必须在该文件夹中的格式。 谢谢, 米^ E
我正在尝试第一次安装服务器。 我正在运行CentOS 5.5。 在我正在经历的一本名为“CentOS权威指南”的书中,它在关于设置Apache Httpdnetworking服务器的章节中说,为了configuration防火墙,我应该运行“setuptool”工具,它给出了一个很好的用于configuration各种事物的GUI。 唯一的事情是,我的setuptool只显示一个选项 – 身份validationconfiguration,而书中有一个选项,其中包括我想要的是防火墙configuration。 这是我在电脑上看到的: 这就是本书所说的我应该看到的: 任何人都可以告诉我,我需要做什么来让setuptool拥有我需要的所有选项? 非常感谢