1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>Redirecting and Remapping with mod_rewrite - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body id="manual-page"><div id="page-header">
17 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
18 <p class="apache">Apache HTTP Server Version 2.5</p>
19 <img alt="" src="../images/feather.gif" /></div>
20 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
22 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Rewrite</a></div><div id="page-content"><div id="preamble"><h1>Redirecting and Remapping with mod_rewrite</h1>
24 <p><span>Available Languages: </span><a href="../en/rewrite/remapping.html" title="English"> en </a></p>
28 <p>This document supplements the <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
29 <a href="../mod/mod_rewrite.html">reference documentation</a>. It describes
30 how you can use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to redirect and remap
31 request. This includes many examples of common uses of mod_rewrite,
32 including detailed descriptions of how each works.</p>
34 <div class="warning">Note that many of these examples won't work unchanged in your
35 particular server configuration, so it's important that you understand
36 them, rather than merely cutting and pasting the examples into your
40 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#old-to-new">From Old to New (internal)</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#old-to-new-extern">Rewriting From Old to New (external)</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#movehomedirs">Resource Moved to Another Server</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#static-to-dynamic">From Static to Dynamic</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#backward-compatibility">Backward Compatibility for file extension change</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#canonicalhost">Canonical Hostnames</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#multipledirs">Search for pages in more than one directory</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#archive-access-multiplexer">Redirecting to Geographically Distributed Servers</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#browser-dependent-content">Browser Dependent Content</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#canonicalurl">Canonical URLs</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#moveddocroot">Moved <code>DocumentRoot</code></a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#fallback-resource">Fallback Resource</a></li>
52 </ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="intro.html">mod_rewrite introduction</a></li><li><a href="access.html">Controlling access</a></li><li><a href="vhosts.html">Virtual hosts</a></li><li><a href="proxy.html">Proxying</a></li><li><a href="rewritemap.html">Using RewriteMap</a></li><li><a href="advanced.html">Advanced techniques</a></li><li><a href="avoid.html">When not to use mod_rewrite</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
53 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
55 <h2><a name="old-to-new" id="old-to-new">From Old to New (internal)</a></h2>
63 <p>Assume we have recently renamed the page
64 <code>foo.html</code> to <code>bar.html</code> and now want
65 to provide the old URL for backward compatibility. However,
66 we want that users of the old URL even not recognize that
67 the pages was renamed - that is, we don't want the address to
68 change in their browser.</p>
74 <p>We rewrite the old URL to the new one internally via the
77 <pre class="prettyprint lang-config">
79 RewriteRule ^<strong>/foo</strong>\.html$ <strong>/bar</strong>.html [PT]
85 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
87 <h2><a name="old-to-new-extern" id="old-to-new-extern">Rewriting From Old to New (external)</a></h2>
95 <p>Assume again that we have recently renamed the page
96 <code>foo.html</code> to <code>bar.html</code> and now want
97 to provide the old URL for backward compatibility. But this
98 time we want that the users of the old URL get hinted to
99 the new one, i.e. their browsers Location field should
106 <p>We force a HTTP redirect to the new URL which leads to a
107 change of the browsers and thus the users view:</p>
109 <pre class="prettyprint lang-config">
111 RewriteRule ^<strong>/foo</strong>\.html$ <strong>bar</strong>.html [<strong>R</strong>]
119 <p>In this example, as contrasted to the <a href="#old-to-new-intern">internal</a> example above, we can simply
120 use the Redirect directive. mod_rewrite was used in that earlier
121 example in order to hide the redirect from the client:</p>
123 <pre class="prettyprint lang-config">Redirect /foo.html /bar.html</pre>
129 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
130 <div class="section">
131 <h2><a name="movehomedirs" id="movehomedirs">Resource Moved to Another Server</a></h2>
136 <dt>Description:</dt>
139 <p>If a resource has moved to another server, you may wish to have
140 URLs continue to work for a time on the old server while people
141 update their bookmarks.</p>
147 <p>You can use <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to redirect these URLs
148 to the new server, but you might also consider using the Redirect
149 or RedirectMatch directive.</p>
151 <pre class="prettyprint lang-config">#With mod_rewrite
153 RewriteRule ^/docs/(.+) http://new.example.com/docs/$1 [R,L]
157 <pre class="prettyprint lang-config">#With RedirectMatch
158 RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1
162 <pre class="prettyprint lang-config">#With Redirect
163 Redirect /docs/ http://new.example.com/docs/
169 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
170 <div class="section">
171 <h2><a name="static-to-dynamic" id="static-to-dynamic">From Static to Dynamic</a></h2>
176 <dt>Description:</dt>
179 <p>How can we transform a static page
180 <code>foo.html</code> into a dynamic variant
181 <code>foo.cgi</code> in a seamless way, i.e. without notice
182 by the browser/user.</p>
188 <p>We just rewrite the URL to the CGI-script and force the
189 handler to be <strong>cgi-script</strong> so that it is
190 executed as a CGI program.
191 This way a request to <code>/~quux/foo.html</code>
192 internally leads to the invocation of
193 <code>/~quux/foo.cgi</code>.</p>
195 <pre class="prettyprint lang-config">
198 RewriteRule ^foo\.html$ foo.cgi [H=<strong>cgi-script</strong>]
204 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
205 <div class="section">
206 <h2><a name="backward-compatibility" id="backward-compatibility">Backward Compatibility for file extension change</a></h2>
211 <dt>Description:</dt>
214 <p>How can we make URLs backward compatible (still
215 existing virtually) after migrating <code>document.YYYY</code>
216 to <code>document.XXXX</code>, e.g. after translating a
217 bunch of <code>.html</code> files to <code>.php</code>?</p>
223 <p>We rewrite the name to its basename and test for
224 existence of the new extension. If it exists, we take
225 that name, else we rewrite the URL to its original state.</p>
227 <pre class="prettyprint lang-config">
228 # backward compatibility ruleset for
229 # rewriting document.html to document.php
230 # when and only when document.php exists
231 <Directory /var/www/htdocs>
233 RewriteBase /var/www/htdocs
235 RewriteCond $1.php -f
236 RewriteCond $1.html !-f
237 RewriteRule ^(.*).html$ $1.php
245 <p>This example uses an often-overlooked feature of mod_rewrite,
246 by taking advantage of the order of execution of the ruleset. In
247 particular, mod_rewrite evaluates the left-hand-side of the
248 RewriteRule before it evaluates the RewriteCond directives.
249 Consequently, $1 is already defined by the time the RewriteCond
250 directives are evaluated. This allows us to test for the existence
251 of the original (<code>document.html</code>) and target
252 (<code>document.php</code>) files using the same base filename.</p>
254 <p>This ruleset is designed to use in a per-directory context (In a
255 <Directory> block or in a .htaccess file), so that the
256 <code>-f</code> checks are looking at the correct directory path.
257 You may need to set a <code class="directive"><a href="../mod/mod_rewrite.html#rewritebase">RewriteBase</a></code> directive to specify the
258 directory base that you're working in.</p>
262 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
263 <div class="section">
264 <h2><a name="canonicalhost" id="canonicalhost">Canonical Hostnames</a></h2>
269 <dt>Description:</dt>
271 <dd>The goal of this rule is to force the use of a particular
272 hostname, in preference to other hostnames which may be used to
273 reach the same site. For example, if you wish to force the use
274 of <strong>www.example.com</strong> instead of
275 <strong>example.com</strong>, you might use a variant of the
276 following recipe.</dd>
282 <p>The very best way to solve this doesn't involve mod_rewrite at all,
283 but rather uses the <code class="directive"><a href="../mod/mod_alias.html#redirect">Redirect</a></code>
284 directive placed in a virtual host for the non-canonical
287 <pre class="prettyprint lang-config">
288 <VirtualHost *:80>
289 ServerName undesired.example.com
290 ServerAlias example.com notthis.example.com
292 Redirect / http://www.example.com/
295 <VirtualHost *:80>
296 ServerName www.example.com
301 <p>You can alternatively accomplish this using the
302 <code class="directive"><a href="../mod/core.html#if"><If></a></code>
305 <pre class="prettyprint lang-config">
306 <If "%{HTTP_HOST} != 'www.example.com'">
307 Redirect / http://www.example.com/
312 <p>Or, for example, to redirect a portion of your site to HTTPS, you
313 might do the following:</p>
315 <pre class="prettyprint lang-config">
316 <If "%{SERVER_PROTOCOL} != 'HTTPS'">
317 Redirect /admin/ https://www.example.com/admin/
322 <p>If, for whatever reason, you still want to use <code>mod_rewrite</code>
323 - if, for example, you need this to work with a larger set of RewriteRules -
324 you might use one of the recipes below.</p>
326 <p>For sites running on a port other than 80:</p>
327 <pre class="prettyprint lang-config">
328 RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
329 RewriteCond %{HTTP_HOST} !^$
330 RewriteCond %{SERVER_PORT} !^80$
331 RewriteRule ^/?(.*) http://www.example.com:%{SERVER_PORT}/$1 [L,R,NE]
335 <p>And for a site running on port 80</p>
336 <pre class="prettyprint lang-config">
337 RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
338 RewriteCond %{HTTP_HOST} !^$
339 RewriteRule ^/?(.*) http://www.example.com/$1 [L,R,NE]
344 If you wanted to do this generically for all domain names - that
345 is, if you want to redirect <strong>example.com</strong> to
346 <strong>www.example.com</strong> for all possible values of
347 <strong>example.com</strong>, you could use the following
350 <pre class="prettyprint lang-config">
351 RewriteCond %{HTTP_HOST} !^www\. [NC]
352 RewriteCond %{HTTP_HOST} !^$
353 RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE]
357 <p>These rulesets will work either in your main server configuration
358 file, or in a <code>.htaccess</code> file placed in the <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> of the server.</p>
362 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
363 <div class="section">
364 <h2><a name="multipledirs" id="multipledirs">Search for pages in more than one directory</a></h2>
369 <dt>Description:</dt>
372 <p>A particular resource might exist in one of several places, and
373 we want to look in those places for the resource when it is
374 requested. Perhaps we've recently rearranged our directory
375 structure, dividing content into several locations.</p>
381 <p>The following ruleset searches in two directories to find the
382 resource, and, if not finding it in either place, will attempt to
383 just serve it out of the location requested.</p>
385 <pre class="prettyprint lang-config">
388 # first try to find it in dir1/...
389 # ...and if found stop and be happy:
390 RewriteCond %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI} -f
391 RewriteRule ^(.+) %{DOCUMENT_ROOT}/<strong>dir1</strong>/$1 [L]
393 # second try to find it in dir2/...
394 # ...and if found stop and be happy:
395 RewriteCond %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI} -f
396 RewriteRule ^(.+) %{DOCUMENT_ROOT}/<strong>dir2</strong>/$1 [L]
398 # else go on for other Alias or ScriptAlias directives,
406 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
407 <div class="section">
408 <h2><a name="archive-access-multiplexer" id="archive-access-multiplexer">Redirecting to Geographically Distributed Servers</a></h2>
413 <dt>Description:</dt>
416 <p>We have numerous mirrors of our website, and want to redirect
417 people to the one that is located in the country where they are
424 <p>Looking at the hostname of the requesting client, we determine
425 which country they are coming from. If we can't do a lookup on their
426 IP address, we fall back to a default server.</p>
427 <p>We'll use a <code class="directive"><a href="../mod/mod_rewrite.html#rewritemap">RewriteMap</a></code>
428 directive to build a list of servers that we wish to use.</p>
430 <pre class="prettyprint lang-config">
433 RewriteMap multiplex txt:/path/to/map.mirrors
434 RewriteCond %{REMOTE_HOST} ([a-z]+)$ [NC]
435 RewriteRule ^/(.*)$ ${multiplex:<strong>%1</strong>|http://www.example.com/}$1 [R,L]
439 <div class="example"><p><code>
440 ## map.mirrors -- Multiplexing Map<br />
442 de http://www.example.de/<br />
443 uk http://www.example.uk/<br />
444 com http://www.example.com/<br />
451 <div class="warning">This ruleset relies on
452 <code class="directive"><a href="../mod/core.html#hostnamelookups">HostNameLookups</a></code>
453 being set <code>on</code>, which can be
454 a significant performance hit.</div>
456 <p>The <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>
457 directive captures the last portion of the hostname of the
458 requesting client - the country code - and the following RewriteRule
459 uses that value to look up the appropriate mirror host in the map
464 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
465 <div class="section">
466 <h2><a name="browser-dependent-content" id="browser-dependent-content">Browser Dependent Content</a></h2>
471 <dt>Description:</dt>
474 <p>We wish to provide different content based on the browser, or
475 user-agent, which is requesting the content.</p>
481 <p>We have to decide, based on the HTTP header "User-Agent",
482 which content to serve. The following config
483 does the following: If the HTTP header "User-Agent"
484 contains "Mozilla/3", the page <code>foo.html</code>
485 is rewritten to <code>foo.NS.html</code> and the
486 rewriting stops. If the browser is "Lynx" or "Mozilla" of
487 version 1 or 2, the URL becomes <code>foo.20.html</code>.
488 All other browsers receive page <code>foo.32.html</code>.
489 This is done with the following ruleset:</p>
491 <pre class="prettyprint lang-config">
492 RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.*
493 RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>]
495 RewriteCond %{HTTP_USER_AGENT} ^Lynx/ [OR]
496 RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12]
497 RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>]
499 RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>]
505 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
506 <div class="section">
507 <h2><a name="canonicalurl" id="canonicalurl">Canonical URLs</a></h2>
512 <dt>Description:</dt>
515 <p>On some webservers there is more than one URL for a
516 resource. Usually there are canonical URLs (which are be
517 actually used and distributed) and those which are just
518 shortcuts, internal ones, and so on. Independent of which URL the
519 user supplied with the request, they should finally see the
520 canonical one in their browser address bar.</p>
526 <p>We do an external HTTP redirect for all non-canonical
527 URLs to fix them in the location view of the Browser and
528 for all subsequent requests. In the example ruleset below
529 we replace <code>/puppies</code> and <code>/canines</code>
530 by the canonical <code>/dogs</code>.</p>
532 <pre class="prettyprint lang-config">RewriteRule ^/(puppies|canines)/(.*) /dogs/$2 [R]</pre>
538 This should really be accomplished with Redirect or RedirectMatch
541 <pre class="prettyprint lang-config"> RedirectMatch ^/(puppies|canines)/(.*) /dogs/$2 </pre>
546 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
547 <div class="section">
548 <h2><a name="moveddocroot" id="moveddocroot">Moved <code>DocumentRoot</code></a></h2>
553 <dt>Description:</dt>
556 <p>Usually the <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>
557 of the webserver directly relates to the URL "<code>/</code>".
558 But often this data is not really of top-level priority. For example,
559 you may wish for visitors, on first entering a site, to go to a
560 particular subdirectory <code>/about/</code>. This may be accomplished
561 using the following ruleset:</p>
567 <p>We redirect the URL <code>/</code> to
568 <code>/about/</code>:
571 <pre class="prettyprint lang-config">
573 RewriteRule ^/$ /about/ [<strong>R</strong>]
577 <p>Note that this can also be handled using the <code class="directive"><a href="../mod/mod_alias.html#redirectmatch">RedirectMatch</a></code> directive:</p>
579 <pre class="prettyprint lang-config">RedirectMatch ^/$ http://example.com/about/</pre>
582 <p>Note also that the example rewrites only the root URL. That is, it
583 rewrites a request for <code>http://example.com/</code>, but not a
584 request for <code>http://example.com/page.html</code>. If you have in
585 fact changed your document root - that is, if <strong>all</strong> of
586 your content is in fact in that subdirectory, it is greatly preferable
587 to simply change your <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>
588 directive, or move all of the content up one directory,
589 rather than rewriting URLs.</p>
593 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
594 <div class="section">
595 <h2><a name="fallback-resource" id="fallback-resource">Fallback Resource</a></h2>
599 <dt>Description:</dt>
600 <dd>You want a single resource (say, a certain file, like index.php) to
601 handle all requests that come to a particular directory, except those
602 that should go to an existing resource such as an image, or a css file.</dd>
606 <p>As of version 2.2.16, you should use the <code class="directive"><a href="../mod/mod_dir.html#fallbackresource">FallbackResource</a></code> directive for this:</p>
608 <pre class="prettyprint lang-config">
609 <Directory /var/www/my_blog>
610 FallbackResource index.php
615 <p>However, in earlier versions of Apache, or if your needs are more
616 complicated than this, you can use a variation of the following rewrite
617 set to accomplish the same thing:</p>
619 <pre class="prettyprint lang-config">
620 <Directory /var/www/my_blog>
623 RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-f
624 RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-d
625 RewriteRule ^ index.php [PT]
630 <p>If, on the other hand, you wish to pass the requested URI as a query
631 string argument to index.php, you can replace that RewriteRule with:</p>
633 <pre class="prettyprint lang-config">RewriteRule (.*) index.php?$1 [PT,QSA]</pre>
636 <p>Note that these rulesets can be used in a <code>.htaccess</code>
637 file, as well as in a <Directory> block.</p>
644 <div class="bottomlang">
645 <p><span>Available Languages: </span><a href="../en/rewrite/remapping.html" title="English"> en </a></p>
646 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
647 <script type="text/javascript"><!--//--><![CDATA[//><!--
648 var comments_shortname = 'httpd';
649 var comments_identifier = 'http://httpd.apache.org/docs/trunk/rewrite/remapping.html';
651 if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
652 d.write('<div id="comments_thread"><\/div>');
653 var s = d.createElement('script');
654 s.type = 'text/javascript';
656 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
657 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
660 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
662 })(window, document);
663 //--><!]]></script></div><div id="footer">
664 <p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
665 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
666 if (typeof(prettyPrint) !== 'undefined') {