Articles of .htaccess

Apache更改代理请求的URL重写

我有代理请求的问题。 我需要启用Apache的mod_proxy为我的子域名,但我忘了从mydomain.com设置允许,这是从所有的允许…是的,我创build了所有世界的开放代理…所以,现在当我从所有设置拒绝,从mydomain.com允许我得到的错误,一些客户端已被拒绝,因为服务器configuration这是好的,并在access.log我已经得到一些与返回代码403这也是很好的请求。 这是要求之一。 例如 GET http://www.google.com HTTP/1.1 403 462 "-"Mozilla/4.0 (compatible; MSIE 6.0;) 我的问题是我可以修改正在对我来一些另一个url的url? 我可以更改此url“google.com”为“mydomain.com”?

.htaccess重写规则不重写别名

我正在尝试为备用子域名提供不同的robots.txt,以便使域名分片,以便Google不索引m1.example.com和m2.example.com。 /etc/httpd/sites-enabled/www.example.com Alias /robots.txt /var/www/html/robots.txt …. ServerName www.example.com ServerAlias m1.example.com m2.example.com …. DocumentRoot /var/www/www.example.com/public /var/www/www.example.com/public/.htaccess RewriteEngine on RewriteCond %{HTTP_HOST} !=www.example.com [NC] RewriteRule ^/robots\.txt$ /var/www/html/robots-disallow.txt [L] …. 当我点击m1.example.com/robots.txt时,它会显示robots.txt而不是robots-disallow.txt。 如果我在/etc/httpd/sites-enabled/www.example.com中将重写规则添加到我的虚拟主机,它可以正常工作,但不会在.htaccess

如何在Apache Web Server中添加redirecturl的重写规则

我正在尝试为我的邮件服务器configurationoutlook和thunderbird的自动发现function。 我已经添加了一个虚拟主机条目以下重写规则redirectconfig-v1.1.xml到thunderbird.php和autodiscover.xml到outlook.php NameVirtualHost 192.168.0.153:80 <VirtualHost 192.168.0.153:80> ServerAdmin [email protected] DocumentRoot /var/www/webroot ServerName autconfig.test.int RewriteEngine On RewriteRule ^/mail/config-v1\.1\.xml$ thunderbird.php [NC,L] RewriteRule ^/autodiscover/autodiscover\.xml outlook.php [NC,L] </VirtualHost> 任何人可以告诉我什么是错误,因为我得到错误404没有find? 我还没有做任何.htaccess文件

Windows Active Directory身份validation和XAMPP Apache服务器

我在Windows 2008服务器中安装了XAMPP服务器,并且想限制对htdocs文件夹的访问,所以只有在Active Directory中的用户才能看到我的Intranet网站。 我在http.confd中启用了以下模块: LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule ldap_module modules/mod_ldap.so 这是我的.htaccess文件: AuthLDAPBindDN "CN=Mohammad Hesabi,OU=IT Internal,OU=IT,OU=TT,DC=ttcom,DC=local" AuthLDAPBindPassword "password" AuthLDAPURL "ldap://172.16.2.3:389/OU=TT,DC=ttcom,DC=local?sAMAccountName?sub?(objectClass=*)" # if I remove the line below it gives me error 500 internal server error after first login attemp AuthLDAPBindAuthoritative off AuthType Basic AuthName "USE YOUR WINDOWS ACCOUNT" AuthBasicProvider ldap AuthUserFile /dev/null require valid-user 但是,当我尝试login,我无法login和login框不断popup。 [Sun […]

.htaccess AuthType不是我所期望的

我正在PhP上工作一个新项目,遇到了一些我不熟悉的东西/找不到任何帮助。 在我看到的目录的.htaccess文件 AuthType UWNetID require valid-user 我只见过基本的东西,在这里消化。 有人可以帮忙解释一下这里可能会发生什么吗? 请原谅,如果这是讨论的其他地方,我只是找不到一个post,解决这种性质的东西。 请记住,华盛顿大学(华盛顿大学)和NetID是一个学生的ID,他们正在使用Shibbolethauthentication。

带有SSL的apache robots.txt

我有一个带有重写规则的.htaccess文件来获取每个HTTP请求redirect到HTTPS。 但现在我有一个问题,我的robots.txt不被一些在线检查器识别。 如果我从.htaccess文件中删除redirect,robots.txt被正确识别。 也许我应该排除robots.txtredirect到HTTPS连接? 这是redirect到HTTPS的.htaccess的一部分 RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{HTTP_HOST}/$1 [L]

尝试访问.php文件时,Apache2 – 500服务器错误

我有一个networking服务器(Apache2,在Ubuntu Saucy Salamander 13.0x上configuration)。 在这台服务器上,我有以下文件: /var/www/xxxxx.com/insertToDB.php 使用500 Internal Server Error GET结果访问此文件。 我已经尝试configurationsites-available/xxxxx.com.conf到以下内容: <Files *.php> Order Deny,Allow Deny from all Allow from 127.0.0.1 </Files> <Files insertToDB.php> Order Allow,Deny Allow from all </Files> (和所有其他的变化,允许所有这个特定的文件,PHP扩展通配符和什么不是..)。 我也使用.htaccess文件直接在文件所在的文件夹(在xxxx.com虚拟主机中)和其父文件上做同样的事情。 500 internal server error仍然存在。 我们已经检查了所有的Apache error.log和access.log 。 没有显示与PHP5安装相关的任何特定错误(在其他虚拟主机上,以及index.php文件)或版本,或任何我们可以解决的问题。 也许我们没有在正确的地方search(?)。 最后,我将sites-available/yyyy.con.conf (允许index.php文件的vhost,从Web访问时运行良好) sites-available/xxxx.com.conf到sites-available/xxxx.com.conf文件(如下所示)。 然而没有任何工作 *每次更改后,Apache服务器都会重置:) <VirtualHost *:80> # Server name ServerName xxxx.com # […]

如何在htaccess中允许访问站点根文件?

我正在努力完成的任务看起来很简单:允许每个人都使用该网站的index.html ,并隐藏每个人的所有内容。 不用说, index.html文件可以被parsing为http://example.com/index.html或只是http://example.com/ 。 Order Deny,Allow Deny from all <Files "index.html"> Allow from all </Files> 适用于第一种情况(当用户明确指定文档名称时),但不适用于第二种情况(只提供站点根URL并将文档选为缺省值时)。 我应该使用什么语法?

为什么我不能将url中的“index.html”redirect到一个php文件?

我陷入了一个大问题,但让我从一个部分开始。 我正在为此工作: RewriteRule ^(.*)index.html $1 [R=301,L] 虽然这不: RewriteCond %{REQUEST_FILENAME} index\.html [NC] RewriteRule ^(.*) main.redirect.php [QSA,L] 而这个也不行: RewriteRule ^(.*)index.html main.redirect.php [NC,QSA,L] 有任何想法吗? 我使用这个作为主要问题的一部分,客户希望我只对以下一个或所有条件进行一次redirect www缺失(放在前面) index.html在最后(删除它) CAPS存在(转换为小写) 为了达到这个目的,我创build了一个能完成所有工作的php文件,我需要在上面的任一条件中调用它(php文件将会redirect)。 <?php $sURL = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; echo '$sURL = ' . $sURL . '<br />'; $sURL = strtolower($sURL); if (substr($sURL, 0, 4) != 'www.') { $sURL = 'www.' . […]

通过在htaccess中重写阻止引用域及其所有子域

我正在寻找阻止两个推荐人及其所有子域名。 当在我的htaccess中使用这个,他们没有得到一个403,而是一个来自Apache的500响应(抱怨太多的内部redirect),所以我想知道为什么它导致 这是我使用的代码: RewriteEngine on RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*domain2\.com [NC,OR] RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*domain\.com [NC] RewriteRule .* – [F] 推荐人通过: http://sub.domain.com/page.php?u=http://example.com (他们有多个子域..总是改变..上面的example.com是我的域名) 基本上,他们乱丢我的谷歌分析W /假推介 – 所以我想阻止他们出现。 以下是来自apache日志的错误:由于可能的configuration错误,请求超过了10个内部redirect的限制。