background preloader

Server

Facebook Twitter

Post/Redirect/Get. Diagram of a double POST problem encountered in user agents.

Post/Redirect/Get

Diagram of the double POST problem above being solved by PRG. Duplicate form submissions[edit] To avoid this problem, many web developers use the PRG pattern[1] — instead of returning a web page directly, the POST operation returns a redirection command. The HTTP 1.1 specification introduced the HTTP 303 ("See other") response code to ensure that in this situation, the web user's browser can safely refresh the server response without causing the initial HTTP POST request to be resubmitted. However most common commercial applications in use today (new and old alike) still continue to issue HTTP 302 ("Found") responses in these situations. If a web user refreshes before the initial submission has completed because of server lag, resulting in a duplicate HTTP POST request in certain user agents. A commonly used alternative to the PRG pattern is the use of a nonce to prevent duplicate form submissions.[2] Bookmarks[edit] 易懂、实用、全面的CentOS Linux教程. Apache Rewrite学习_上口蜗牛.

深入理解Apache的mod_rewrite. 在我的基本身份验证的第一个教程中,我提到了在htpasswd的工具。 你可以使用诸如apachectl或者httpd的其他工具直接对模块进行测试。 有命令行开关可以使你检查现有的已经安装加载的模块。 您可以执行下面的命令来得到一个所有已加载的模块的列表。 Shell> apachectl -t -D DUMP_MODULES 这里我展示的是这个命令的帮组页面。 最后,如果你还是不能确定它是否启用了,像以前一样将它注释掉,看看会发生什么! # Redirect everything in this directory to "good.html" RewriteEngine on RewriteRule .* good.html 下面是正确的和错误的页面: .htaccess的内容 通常情况下,你可以写在.htaccess文件中的内容也可以写到全局配置文档中。

如果你将【……】规则放到了.htaccess文件中,目录的前缀(/)在REQUEST_URI变量中会被去掉,因为所有的请求会被自动假设是现在目录的相对地址。 有一点要记住,如果你在网上看例子或者是你自己在测试一个实例,要注意前面的斜线! 正则表达式 本教程不打算教你正则表达式。 如果你不知道正则表达式,下面这些有用的教程会让你快速入门: 还有每个人都应该知道的一些引用: 初次体验 好了,你等待的耐心已经足够大了,让我们快速的看一个例子。 # Enable Rewriting RewriteEngine on # Rewrite user URLs # Input: user/NAME/ # Output: user.php? 在我对它做任何解释之前,我会先讲解一下目录中的另外一个文件。 目录中包含两个文件:index.php和user.php。 这个例子有一些不同的地方。 第一个重写规则是用来处理user.php页面的。 T规则: RewriteRule ^user/(w+)/? 下面是一些例子及对上面每行话的解释: 注意:如果这个例子不能在你的机器上运行,可能是由于你的Apache或mod_rewrite 版本与PCRE不兼容。 执行流程详情 重写规则的执行流程比较简单,但不是完全明了。 为了说的更具体一点儿,下面是Apache的文档中对mod_rewrite中“URL部分”的描述:

Apache mod_rewrite各模块详细介绍. Mod_rewrite模块 mod_rewrite模块可以操作URL的所有部分(包括路径信息部分), 在服务器级的(httpd.conf)和目录级的(.htaccess)配置都有效,还可以生成最终请求串。 此重写操作的结果可以是内部子处理,也可以是外部请求的转向, 甚至还可以是内部代理处理。 但是,所有这些功能和灵活性带来一个问题,那就是复杂性, 因此,不要指望一天之内就能看懂整个模块。 内部处理 mod_rewrite模块的内部处理极为复杂,但是,为了使一般用户避免犯低级错误, 也让管理员能充分利用其功能,在此仍然做一下说明。 API程序段 首先,你必须了解,Apache是通过若干程序段来处理HTTP请求的。 所以,Apache收到一个请求并且确定了响应主机(或者是虚拟主机)之后,重写引擎即开始执行URL到文件名程序段,以处理服务器级的配置中所有的mod_rewrite指令。 虽然mod_rewrite可以重写URL为URL,重写URL为文件名,甚至重写文件名为文件名,但是目前API只提供一个URL到文件名的hook。 牢记这两点! 规则集的处理 当mod_rewrite在这两个程序段中开始执行时,它会读取配置结构中的配置好的 (或者是在服务启动时建立的服务器级的,或者是Apache核心在遍历目录采集到的目录级的)规则集,随后,启动URL重写引擎来处理(带有一个或多个条件)的规则集。 Minify - Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads.

News 2013-07-23 Minify 2.1.7 is released in response to a serious vulnerability discovered in all previous versions.

minify - Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads.

You are strongly urged to follow the instructions in the report to secure your installation, and to upgrade to Minify 2.1.7. 2013-07-19 Minify 2.1.6 released. This fixes several JSMin bugs. Check the history for more details. About Minify is a PHP5 app that helps you follow several of Yahoo! ' It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

Support List Minify in Use The stats above are from a brief walkthrough which shows how easy it is to set up Minify on an existing site. The design is somewhat similar to Yahoo's Combo Handler Service, except that Minify can combine any local JS/CSS files you need for your page. Minify integrated into other Projects/Plugins Features Requirements Installation See the UserGuide. Support List PHP5 Component Classes Warnings Problem Domain. Apache URL重定向指南 - 星星呓语 * 电子商务,市场营销,网络编程,站长手记,心情随笔 -     只要感兴趣,都要学一些 ;) Mod_rewrite入门 Apache mod_rewrite 模块是一个处理 URL 而又极为复杂的模块,使用 mod_rewrite 你可处理所有和 URL 有关的问题,你所付出的就是花时间去了解 mod_rewrite 的复杂架构,一般初学者都很难实时理解 mod_rewrite 的用法,有时 Apache 专家也要 mod_rewrite 来发展 Apache 的新功能。

Apache URL重定向指南 - 星星呓语 * 电子商务,市场营销,网络编程,站长手记,心情随笔 -     只要感兴趣,都要学一些 ;)

换句话说,当你成功使用 mod_rewrite做到你期望的东西,就不要试图再接触mod_rewrite了,因为mod_rewrite的功能实在过于强大。 Mod_rewrite入门(功能实在太强大了) - tangguyan的日志 LUPA开源社区. Apache的Mod_rewrite 例子. 最新分享_分享_百度空间. 最新分享_分享_百度空间.