comparison xml/en/docs/http/converting_rewrite_rules.xml @ 51:d1e8781b9c5f

Fixing the wording.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 03 Oct 2011 10:59:42 +0000
parents 9d544687d02c
children ee725af08951
comparison
equal deleted inserted replaced
50:9d544687d02c 51:d1e8781b9c5f
8 <section title="A redirect to a main site"> 8 <section title="A redirect to a main site">
9 9
10 <para> 10 <para>
11 People who during their shared hosting life used to configure 11 People who during their shared hosting life used to configure
12 <i>everything</i> using <i>only</i> Apache&rsquo;s .htaccess files, 12 <i>everything</i> using <i>only</i> Apache&rsquo;s .htaccess files,
13 translate usually the following rules: 13 usually translate the following rules:
14 14
15 <programlisting> 15 <programlisting>
16 RewriteCond %{HTTP_HOST} nginx.org 16 RewriteCond %{HTTP_HOST} nginx.org
17 RewriteRule (.*) http://www.nginx.org$1 17 RewriteRule (.*) http://www.nginx.org$1
18 </programlisting> 18 </programlisting>
19 19
20 in something like this: 20 to something like this:
21 21
22 <programlisting> 22 <programlisting>
23 server { 23 server {
24 listen 80; 24 listen 80;
25 server_name www.nginx.org nginx.org; 25 server_name www.nginx.org nginx.org;
54 54
55 55
56 <section> 56 <section>
57 57
58 <para> 58 <para>
59 Another example, instead of backward logic: all that is not 59 Another example.
60 <url>nginx.com</url> and is not <url>www.nginx.com</url>: 60 Instead of the &ldquo;upside-down&rdquo; logic &ldquo;all that is not
61 <url>nginx.com</url> and is not <url>www.nginx.com</url>&rdquo;:
61 62
62 <programlisting> 63 <programlisting>
63 RewriteCond %{HTTP_HOST} !nginx.com 64 RewriteCond %{HTTP_HOST} !nginx.com
64 RewriteCond %{HTTP_HOST} !www.nginx.com 65 RewriteCond %{HTTP_HOST} !www.nginx.com
65 RewriteRule (.*) http://www.nginx.com$1 66 RewriteRule (.*) http://www.nginx.com$1
66 </programlisting> 67 </programlisting>
67 68
68 you should define just <url>nginx.com</url>, <url>www.nginx.com</url>, 69 one should simply define <url>nginx.com</url>, <url>www.nginx.com</url>,
69 and anything else: 70 and &ldquo;everything else&rdquo;:
70 71
71 <programlisting> 72 <programlisting>
72 server { 73 server {
73 listen 80; 74 listen 80;
74 server_name nginx.com www.nginx.com; 75 server_name nginx.com www.nginx.com;