我有随机IP不断瞄准我的Apache服务器。 我在日志中获得的样本: 80.108.96.31 – – [18/Aug/2017:16:16:08 +0000] "GET /machine.xml HTTP/1.1" 403 520 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 200.163.163.189 – – [18/Aug/2017:16:16:08 +0000] "GET /machine.xml HTTP/1.1" 403 520 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET […]
我有一个在以下规则的子域的htaccess: RewriteEngine On RewriteBase / RewriteRule ^feed([0-9]+)$ ../image.php?id=$1 [L] 所以基本上我想redirect请求从位于子域的饲料到位于主域(只是一个目录上面)的image.php文件。 使用../似乎不像PHP中的工作。 那么我怎么能重写到父目录中的文件?
Apache接收到一个带有编码分号(%3B)的请求,在将请求传递给代理(Spring Tomcat的后端)之前将其解码。 相关的apache虚拟主机行是: ProxyPreserveHost on RequestHeader set X-Forwarded-Proto https ProxyPass / http://127.0.0.1:8081/ ProxyPassReverse / http://127.0.0.1:8081/ 所以例如当一个URL的请求像 http://testsite.com/page/%27+many+times%3B+the+valiant/author 将代理转发为 http://testsite.com/page/%27+many+times/author 有什么我可以做的,以防止阿帕奇解码该URL之前转发给代理? 也许在apache.org/bugzilla上提到相关的问题
我的Web服务器使用lighttpd和PHP-FPM运行PHP应用程序多年。 现在,在第三方软件升级之后,我必须包含一些规则才能激活REST API。 <IfModule mod_setenvif.c> SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 </IfModule> <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase /api/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] </IfModule> 我想知道它在做什么,如果它有支持的话,可以基于lighttpdconfiguration重写它。
我想写一个简单的重写规则,将会改变: https://example.com/index.php?shortened_url=value 至 https://example.com/value 为了达到这个目的,我使用了下面的重写规则: RewriteEngine On RewriteRule ^([^/]*)$ /index.php?shortened_url=$1 [L] 但是我收到错误: 由于可能的configuration错误,请求超出了10个内部redirect的限制。 显然这表明有一个循环问题的地方,但据我所知,我的规则是非常简单的,不应该导致任何循环?
我使用mod_rewrite将/foo/bar/baz映射到/foo/qux RewriteEngine on RewriteBase /foo/ RewriteRule ^bar/baz$ bar/baz/ [L,R=permanent] RewriteRule ^bar/baz/(.*) qux/$1 [L] 我想允许/foo/qux索引,所以我在/foo/qux/.htaccess有Options +Indexes 。 问题是,即使用来访问它的URL是/foo/bar/baz ,索引输出也会读取“ Index of /foo/qux ”。 理想情况下,我希望输出反映使用的URL(所以/foo/qux或/foo/bar/baz ,取决于)。 我会为输出总是说“ /foo/bar/baz索引”。 有没有办法使用mod_rewrite或简单的香草Apacheconfiguration选项来做到这一点?
我在Apache VirtualHostconfiguration中有几个RewriteRules。 我想能够testing当前的URL(在重写之前)针对某些条件。 问题在于variables%REQUEST_URI在处理开始时被设置,并且在每个规则之后都不会改变。 关于这些variables的文档很less。 有没有办法使用RewriteCond来testing当前的url? 我已经启用了重写日志,很明显,即使在第一个RewriteRule被匹配并重写之后,%REQUEST_URI仍然被设置为“/” #Map '/' and '' to '/home' RewriteRule ^/?$ /home #Check for cached page RewriteCond %{DOCUMENT_ROOT}/system/cache%{REQUEST_URI}.html -f RewriteRule ^(.+)$ /system/cache/$1.html [QSA,L] 有没有简单的方法来完成这个? 编辑:这是从RewriteLog摘录,我不认为是一个内部的子请求正在发生。 (3) applying pattern '^/?$' to uri '/' (2) rewrite '/' -> '/home' (3) applying pattern '^([^.]+)$' to uri '/home' (4) RewriteCond: input='/var/www/vhosts/example.com/subdomains/demo/rails/public/system/cache/.html' pattern='-f' => not-matched (3) […]
我最近上了一个新的网站,其中一个部门把用户引导到一个虚拟域名。 例如,www.ia.domain.com将自己伪装成自己的网站,这真的是domain.com/ia 我想要做的是将所有访问www.ia.domain.com的用户redirect到domain.com/ia, 以及www.ia.domain.com/faculty/ => domain.com/ia/faculty/ 这是在一个新的框,所以它没有原来的configuration。 该网站正在使用Linux(rhel5)在Apache上运行。 我不熟悉mod_rewrite。 我做了301redirect,但我无法redirect一个虚拟子域的方式。
我想在apache上使用mod_rewrite传递一个实际的url作为variables 我有一个页面externalLink.php,可以传递一个URL在奥德做一些魔术即 /externalLink.php?url= http://example.com 我想这是一个很好的URL像/ external / http://example.com 我已经添加了一个重写规则到我的htaccess,我希望可以工作,但作为怀疑它不。 RewriteRule ^ external /([^/.]+)/*$ /externalLink.php?url=$1 [L] 有谁知道这是可能的吗? 提前致谢 .K
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php 这是Zend htaccess,我似乎无法find相当于此的lighttpd .. 感谢:D