所以我试图使用.htaccess禁止从本网站获得的可疑垃圾邮件IP地址的大名单(50,000)。 该列表几乎是1M的大小,当我添加列表中的每个地址拒绝指令…但是当我将加载的.htaccess文件应用到服务器它barf和没有页面加载403错误。 我的问题 有一个.htaccess文件的大小有限制吗? 它可以包含在文件中的IP地址的deny from数量有限制吗? 有没有更好的办法做什么即时通讯在服务器级别尝试做(我明白我可以检查在提交过程中的Web应用程序列表,但我想学习的东西)
我们创build了一个iframe加载器index5.php,它将显示两个iframe,iframe1和iframe2。 iframe2的内容可以通过访问index5.php?url = iframe2url来设置。 所以,去 domain/index5.php?url=www.serverfault.com 将加载serverfault在一个iframe和我们的代码在另一个。 我们只希望能够在我们自己的域名上使用这个来阻止XSS,所以我们确保index5.php只允许我们的域名。 我们还想从所有的请求到我们的wordpress网站 domain/page 至 domain/index5.php?url=http://domain/page 但是,如果我们使用 RewriteCond %{REQUEST_URI} !^/index5\.php$ RewriteCond %{HTTP_HOST} ^domain$ RewriteRule ^(.*)$ http://domain/index5.php?url=http://domain/$1 [R=301,L] 有一个无限的redirect。 我们如何防止这一点?
我试图用Apache 2.2.22静态HTML设置一个网站,但我得到一个500错误,而不是404。 错误日志中的消息是: [Sun Dec 14 09:48:45 2014] [error]由于可能的configuration错误,请求超出了10个内部redirect的限制。 如果需要,使用“LimitInternalRecursion”来增加限制。 使用“LogLeveldebugging”来获得回溯。 当我设置LogLeveldebugging我看到 [Sun Dec 14 09:48:45 2014] [debug] core.c(3112): r->uri = /home/nxad/index.php [Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php [Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php [Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from […]
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 上面的.htaccess代码不会redirect到HTTPS。 为什么? (IfModule被注释掉,目的是显示我没有错过重写模块) 更新 当尝试与http://htaccess.madewithlove.be我收到 RewriteCond %{HTTPS} =on This condition was not met RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301] This rule was not met because one of the conditions was […]
服务器在Apache上运行,并试图阻止libwww-perl,但不知道为什么它不工作。 我已经把以下内容放在我的.htaccess中,但是当我运行testing时,我还是得到了libwww-perl仍然没有被阻塞的通知。 RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} libwww-perl.* RewriteRule .* – [F,L] 我在这里查看post如何创build.htaccess和阻止UserAgent libwww-perl? 但似乎他们正在运行IIS7,所以我不认为这里的答案适用。 我试过添加: SetEnvIfNoCase User-Agent "^Wget" bad_bot SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot SetEnvIfNoCase User-Agent "^libwww-perl" bad_bot <Location /> Order allow,deny Allow from all Deny from env=bad_bot </Location> 在另一篇文章中提到的是http://community.spiceworks.com/how_to/1443-how-to-block-libwww-perl ,但是这给我一个内部的服务器错误500 有任何想法吗? 亲切的问候
我目前有我们的Magento网站redirecthttp到https。 基本上只能通过https访问网站,包括www。 我认为这是工作,但是,它目前显示为302redirect,我想把它做成301.有人可以让我知道如何得到这个工作? 我使用.htaccess尝试了一些不同的东西,但没有运气。 事实上,当301redirect在我们现有的redirect工程的.htaccess文件中,而是直接进入主页时,这是我的主要问题。 # Redirect all "not correct" domain to www with https # (is not important if comes with or without https): RewriteCond %{HTTP_HOST} !^www.gloveclub.co.uk$ [NC] RewriteRule ^(.*)$ https://www.gloveclub.co.uk/$1 [L,R=301] # Redirect all non-ssl to ssl. RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.gloveclub.co.uk/$1 [R,L] 我原来的.htaccess文件内容如下; ############################################ ## uncomment these lines for CGI mode […]
我有一个.htaccess重写,我想移动到一个vhost.conf(我不想使用.htaccess) RewriteRule ^(.*?)(test_mod_rewrite) /$1media/plg_jchoptimize/assets/modrewrite.php?q=$2 RewriteRule ^(.*?)(gz|nz)/([^/]+)/([^/]+)/([^/]+)\.(js|css)$ /$1media/plg_jchoptimize/assets/jscss.php?f=$5&type=$6&gz=$2&d=$3&i=$4 假设我已经启用了适当的模块,并满足了先决条件(RewriteEngine On等),需要进行哪些更改才能使此规则在vhost.conf文件中工作?
我正在尝试使用我的.htaccess文件中的Redirect和RedirectMatch规则来模拟我的站点以前版本的永久链接结构。 我有不同的规则,我会适用于从我的旧网站不同的path。 有些目录没有模拟,我希望他们redirect到一个单一的位置。 有些目录在不同位置包含许多项目(数千个),我希望它们能够巧妙地redirect到新站点中正确的新位置。 似乎我可以在<If>上通过基本的正则expression式testing来防范和分组相关项目,以防止所有包含的分组redirect被testing,如果它们永远不匹配的话。 在这种方法中,生成的configuration看起来是合乎逻辑和一致的,并且可以很容易地自动生成: <If "%{REQUEST_URI} =~ m#^/categories/software/.*#"> # These rules aren't considered if the request wasn't for a subpath of categories/software. <If "%{REQUEST_URI} =~ m#^/categories/software/store/.*#"> # All old store pages now invalid, go to main store. RedirectMatch 301 .* /software-store/ </If> # Regexes for each category of software to group them logically. […]
我正在尝试运行一个内部的Apache服务器。 我正在尝试制作一个像http:// internalserver这样的主页/这将有一些文件和文件夹。 我正在尝试密码保护这些子文件夹之一。 我为此使用.htaccess。 我的问题是,完成后,我的密码保护子文件夹是不可见的在我的基本目录http:// internalserver / 如果我从浏览器访问http:// internalserver / passwordprotected /直接,我可以得到密码提示和经常导航 我在Ubuntu14上运行apache2.4 我希望能够看到密码保护的目录列表,并试图访问它,获取密码提示
我需要上传一个叫index.html的文件和我的index.php一起(请不要问为什么)有没有办法让所有的东西都保持原状,只有在用index.html页面请求的时候,才能提供index.html页面呢? (mysite.com/index.html) 我在apache服务器后面,如果需要,我可以修改.htaccess或虚拟主机。 谢谢