<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>-= n8v =- &#187; apache</title>
	<atom:link href="http://n8v.enteuxis.org/tags/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://n8v.enteuxis.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 27 Sep 2011 00:52:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-beta2-18055</generator>
		<item>
		<title>Deny access to .svn directories with IIS</title>
		<link>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/</link>
		<comments>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 21:40:38 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[Figuring IT Out]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[obscurity]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://n8v.enteuxis.org/?p=295</guid>
		<description><![CDATA[The problem: I like using Subversion to deploy web content to production servers. I check in everything while I&#8217;m working on the development copy, then check out onto the server when it&#8217;s ready. Subversion creates a .svn directory contain readable copies of all your files, which is bad for server-processed files like .php or .aspx [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem:</h3>

<p>I like using Subversion to deploy web content to production servers.  I check in everything while I&#8217;m working on the development copy, then check out onto the server when it&#8217;s ready.</p>

<p>Subversion creates a <code>.svn</code> directory contain readable copies of all your files, which is bad for server-processed files like .php or .aspx that you don&#8217;t want readable by, say, <a href="http://en.wikipedia.org/wiki/Google_hacking">Google Hackers</a>.</p>

<p>I have thought about this before but when I went to do it I couldn&#8217;t find any clear guides online.  I did find <a href="http://serverfault.com/questions/23340/ignoring-svn-directories-under-iis/83480#83480">this question at Server Fault</a>, which is a newish sister of <a href="http://stackoverflow.com">Stack Overflow</a>, which reminds me kind of Experts Exchange but without the suck.  Except that in this case the answers sucked.   So I figured it out and added my answer and am posting it here too:
<span id="more-295"></span></p>

<hr />

<p>&#8220;Don&#8217;t do it that way&#8221; does not answer the question.</p>

<p>Practically, I like having a working copy on the production server, because that way I can make quick changes in production (who has never done that?) and check them back in.  It depends on where you want your security/convenience slider, and in many cases this is a good place.</p>

<p>The standard solution in Apacheland is to leave the .svn files there but tell the web server to never serve them.  Here&#8217;s how to do that with IIS 5 through 7 on Windows NT4 through 2008.</p>

<ol>
<li><p>Download and install <a href="http://www.helicontech.com/isapi_rewrite/">ISAPI_Rewrite</a> &#8212; the Lite version will be enough for this purpose.  There are two versions, version 2 and 3.  Use ISAPI_Rewrite3 unless you need to support NT4.    Also, note the extra <a href="http://www.helicontech.com/isapi_rewrite/doc/sysreq.htm">IIS features</a> you need to enable for Win 2008.<br />
<strong>Warning</strong>&#8211; the MSI installer may stop and start IIS.</p></li>
<li><p>Launch the <em>Helicon->ISAPI_Rewrite3->ISAPI_Rewrite Manager</em> app from the Start Menu.  It makes editing the config file (installed in <em>C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf</em> by default) easier, but you can also do it by hand.  <strong>note</strong>, the config file in ISAPI_Rewrite2 is named <em>httpd.ini</em> and is read-only by default.</p></li>
<li><p>Add these lines to <em>httpd.conf</em>:</p></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="apache"><span class="co1"># Deny access to Subversion working copy administrative</span>
<span class="co1">#  directories (.svn) and their contents</span>
<span class="kw1">RewriteRule</span> .*/\.svn\b.* . [F,I,O]</pre></div></div>


<p>Now, any request for a .svn directory or its contents will result in a 404 Not Found from the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Completely custom Symfony error pages</title>
		<link>http://n8v.enteuxis.org/2009/03/completely-custom-symfony-error-pages/</link>
		<comments>http://n8v.enteuxis.org/2009/03/completely-custom-symfony-error-pages/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 22:39:58 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[Figuring IT Out]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://n8v.enteuxis.org/?p=177</guid>
		<description><![CDATA[For every Symfony project I work on, I eventually want to get rid of the tasteful brown error pages with the Symfony logo on them and install my own, so the users don&#8217;t get weirded out and somehow start thinking &#8220;Symfony = error&#8221;. Also, I&#8217;m probably overly optimistic, but it would be nice if there [...]]]></description>
			<content:encoded><![CDATA[<p>For every Symfony project I work on, I eventually want to get rid of the tasteful brown error pages with the Symfony logo on them and install my own, so the users don&#8217;t get weirded out and somehow start thinking &#8220;Symfony = error&#8221;.  Also, I&#8217;m probably overly optimistic, but it would be nice if there was a valid email address on the error page so I could hear users complain.</p>

<p><a href="http://www.symfony-project.org/book/1_1/19-Mastering-Symfony-s-Configuration-Files#chapter_19_sub_default_modules_and_actions">The documentation</a> is good, but I want a simpler recipe that also accounts for all the forseeable errors, even those that don&#8217;t get to Symfony.  Some details vary by version, but in short, for symfony 1.1:
<span id="more-177"></span></p>

<h3>Test URLs</h3>

<p>We want to ultimately make sure that these URLs behave the right way:</p>

<h4>Normal errors (must have)&#8211; 404 Not Found and 500 Server Error</h4>

<table cellpadding="3">
<tr style="background: rgb(218, 231, 180);"><td>
<var>http://<samp>localhost/myapp</samp>/default/error404</var>
</td><td>
The &#8220;real&#8221; 404 page&#8230; it&#8217;s actually strangely &#8220;found&#8221; in this case.
</td></tr>

<tr><td>

http://<samp>localhost/myapp/mymodule/view</samp>/id/22222

</td><td>
A <code>forward404Unless</code> style forwarding should get the custom 404 page.  This is really the most likely case&#8211; if a user follows a link to an object another user has deleted, I want them to see the nice page.

</td></tr>



<tr style="background: rgb(218, 231, 180);"><td>
http://<samp>localhost/myapp/</samp>junk.php , or 

http://<samp>localhost/myapp/</samp>images/junk.gif

</td><td>
A request that Apache handles should display the custom 404 page too.
</td></tr>

<tr><td>

http://<samp>localhost/myapp</samp>/errors/error500.php

</td><td>
The &#8220;real&#8221; URL of the 500 error page should work.
</td></tr>

<tr style="background: rgb(218, 231, 180);"><td>

http://<samp>localhost/myapp</samp>/awfijwef/awfijawfo

</td><td>
Another real 404 error&#8211; Symfony forwards nonsensical module/action stuff to the custom 404 page.
</td></tr>


</table>

<p>I have seen error 500 pages countless times during app development, but I just could <strong>NOT</strong> reproduce one to test the 500 error page.  Any quick recipes for that, anyone?</p>

<h4>More esoteric error conditions&#8211; app unavailable/locked, module disabled</h4>

<table cellpadding="3">
<tr><td>
<var>http://localhost/myapp/errors/unavailable.php</var>
</td><td>
The &#8220;unavailable&#8221; page for when a whole symfony app is locked with <kbd>symfony project:disable <samp>app env</samp></kbd>*, or while the cache is being cleared.
</td></tr>


<tr style="background: rgb(218, 231, 180);"><td>
any application URL after I run <kbd>symfony project:disable</kbd> and I have the <code>check_lock</code> setting on*
</td><td>
should go to the &#8216;unavailable&#8217; page (unavailable.php)
</td></tr>

<tr><td>
<var>http://localhost/myapp/default/disabled</var>
</td><td>
The real &#8220;I&#8217;m disabled&#8221; page for when a module is locked with <kbd></kbd> in the <a href="http://www.symfony-project.org/book/1_1/06-Inside-the-Controller-Layer#chapter_06_module_configuration">module&#8217;s config file</a>, e.g. <var>apps/frontend/modules/<samp>mymodule</samp>/config/module.yml</var>
</td></tr>

<tr style="background: rgb(218, 231, 180);"><td>
http://<samp>localhost/myapp/</samp>mymodule/myaction , when I&#8217;ve explicitly disabled the module by putting this in <var>apps/frontend/mymodule/config/module.yml</var>:
<pre>
all:
  enabled:     false
</pre>
</td><td>
The disabled page (above)
</td></tr>


</table>

<h3>Steps</h3>

<ol>

    <li>manually create a few files for the <var>default</var> module.  <strong>DO NOT</strong> use <code>symfony generate:module</code> because you only want to override a small bit of the built-in <var>default</var> module (found in <var>/path/to/symfony/lib/controller/default/templates/</var>* incidentally, if you ever want to see what you&#8217;re overriding).


<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">mkdir</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default
$ <span class="kw2">mkdir</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default<span class="sy0">/</span>config
$ <span class="kw2">mkdir</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default<span class="sy0">/</span>templates
$ <span class="kw2">touch</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default<span class="sy0">/</span>config<span class="sy0">/</span>view.yml
$ <span class="kw2">touch</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default<span class="sy0">/</span>templates<span class="sy0">/</span>error404Success.php
$ <span class="kw2">touch</span> apps<span class="sy0">/</span>frontend<span class="sy0">/</span>modules<span class="sy0">/</span>default<span class="sy0">/</span>templates<span class="sy0">/</span>disabledSuccess.php</pre></div></div>



</li>

    <li>Edit the templates I just made&#8211; remember, the content for these goes inside your sitewide <var>layout.php</var>.

I started out by copying the default templates in <var>lib/controller/default/templates/</var> from my Symfony distribution.
</li>
    <li>create mostly static pages for <var>web/errors/error500.php</var> and <var>unavailable.php</var>***  They won&#8217;t be wrapped in layout.php so they need to have the full page structure, and basically no symfony-involving PHP code (like helpers, too bad), though I do use a bit of really basic stuff, like including the URL in my mailto form on the 500 page:


<div class="wp_syntax"><div class="code"><pre class="php">  &lt;dl class=&quot;sfTMessageInfo&quot;&gt;
    &lt;dt&gt;Something is terribly broken.&lt;/dt&gt;
    &lt;dd&gt;
	  &lt;p&gt;
Please 
&lt;a href=&quot;mailto:webmaster@mycompany.com?subject=500 error at http://
<span class="kw2">&lt;?php</span> <span class="kw1">echo</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">'SERVER_NAME'</span><span class="br0">&#93;</span> <span class="sy0">.</span> <span class="st_h">'/'</span><span class="sy0">.</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">'REQUEST_URI'</span><span class="br0">&#93;</span>  <span class="sy1">?&gt;</span>
<span class="kw2">&lt;?php</span> 
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/array_key_exists"><span class="kw3">array_key_exists</span></a><span class="br0">&#40;</span><span class="st_h">'HTTP_REFERER'</span><span class="sy0">,</span> <span class="re0">$_SERVER</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  <span class="kw1">echo</span> <span class="st0">&quot;&amp;body=Referrer: &quot;</span><span class="sy0">.</span><span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">'HTTP_REFERER'</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
 <span class="sy1">?&gt;</span>&quot;&gt;
e-mail us at webmaster@mycompany.com&lt;/a&gt; and let us know what you were doing when this error occurred. We will fix it as soon as possible.
&lt;/p&gt;
	  &lt;p&gt;
   If you have an urgent problem, please call the Support Desk at XXXX.
&lt;/p&gt;
	  &lt;p&gt;
   You may also find the &lt;a href=&quot;/README.html&quot;&gt;documentation&lt;/a&gt; useful.
&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;</pre></div></div>



</li>

    <li>Include my stylesheets, in <var>view.yml</var>:

<pre>
error404Success:
  metas:
    title:        ED Log 404 Not Found
  stylesheets:
    - -*
    - mystyles1: { position: last }
    - mystyles2: {position: last}
    - /sf/sf_default/css/screen.css
    - /sf/sf_default/css/ie.css
    - errors: {position: last}
</pre>
(and the same thing for <code>disabledSuccess:</code>)

My <var>web/css/errors.css</var>  overrides some of the default symfony error page styles (compare <var>web/sf/sf_default/css/screen.css</var> in your symfony distribution) to make them less brown, but I keep the general thing.
</li>

    <li>If your application has security on by default, make sure to un-secure the error pages so people can see them without logging in.  Add these above the <code>default</code> rule in <var>apps/frontend/config/security.yml</var>:

<pre>
error404:
  is_secure: off

disabled:
  is_secure: off
</pre>
</li>


    <li>Tell Apache where to find total 500 errors and 404 errors that don&#8217;t make it to symfony (like anything that doesn&#8217;t get to a front controller, like a misspelled controller or image name):


<div class="wp_syntax"><div class="code"><pre class="apache">  &lt;<span class="kw3">Directory</span> <span class="st0">&quot;/var/www/my_sf_app/web&quot;</span>&gt;
        <span class="kw1">ErrorDocument</span> <span class="nu0">404</span> /default/error404
	<span class="kw1">ErrorDocument</span> <span class="nu0">500</span> /errors/error500.php
  &lt;/<span class="kw3">Directory</span>&gt;</pre></div></div>



</li>

<li>Hrm, the table of URLs above sounds like a good test script&#8230; <strong>BUT</strong>, it resists scripting because most of the error URLs are outside symfony, so you don&#8217;t get the custom error pages when going to an actual error with sfTestBrowser, or even a regular sfBrowser, because instead you get fancy exception stuff.  

So, here&#8217;s a pretty lame test script I put in <var>test/functional/frontend/customErrors.php</var> that tests the easiest cases, but it&#8217;s not hard to manually try the others with a browser.  I welcome suggestions for improvement!


<div class="wp_syntax"><div class="code"><pre class="php">&nbsp;
<span class="kw2">&lt;?php</span>
&nbsp;
<span class="kw1">include</span><span class="br0">&#40;</span><a href="http://www.php.net/dirname"><span class="kw3">dirname</span></a><span class="br0">&#40;</span><span class="kw4">__FILE__</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st_h">'/../../bootstrap/functional.php'</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$e404_regexp</span> <span class="sy0">=</span> <span class="st0">&quot;webmaster@mycompany&quot;</span><span class="sy0">;</span>
<span class="re0">$disabled_regexp</span> <span class="sy0">=</span> <span class="st0">&quot;xXXXX&quot;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// create a new test browser</span>
<span class="re0">$browser</span> <span class="sy0">=</span> <span class="kw2">new</span> sfTestBrowser<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="coMULTI">/* http://localhost/myapp/default/error404	 
The &quot;real&quot; 404 page */</span>
&nbsp;
<span class="re0">$browser</span><span class="sy0">-&gt;</span>
  <span class="me1">get</span><span class="br0">&#40;</span><span class="st_h">'/default/error404'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isStatusCode</span><span class="br0">&#40;</span><span class="nu0">404</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isRequestParameter</span><span class="br0">&#40;</span><span class="st_h">'module'</span><span class="sy0">,</span> <span class="st_h">'default'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isRequestParameter</span><span class="br0">&#40;</span><span class="st_h">'action'</span><span class="sy0">,</span> <span class="st_h">'error404'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">checkResponseElement</span><span class="br0">&#40;</span><span class="st_h">'body'</span><span class="sy0">,</span> <span class="st0">&quot;/<span class="es4">$e404_regexp</span>/&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
&nbsp;
<span class="coMULTI">/* http://localhost/myapp/default/disabled	 
The &quot;unavailable&quot; page for when symfony is locked with symfony project:disable */</span>
&nbsp;
<span class="re0">$browser</span><span class="sy0">-&gt;</span>
  <span class="me1">get</span><span class="br0">&#40;</span><span class="st_h">'/default/disabled'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isStatusCode</span><span class="br0">&#40;</span><span class="nu0">200</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isRequestParameter</span><span class="br0">&#40;</span><span class="st_h">'module'</span><span class="sy0">,</span> <span class="st_h">'default'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">isRequestParameter</span><span class="br0">&#40;</span><span class="st_h">'action'</span><span class="sy0">,</span> <span class="st_h">'disabled'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span>
  <span class="me1">checkResponseElement</span><span class="br0">&#40;</span><span class="st_h">'body'</span><span class="sy0">,</span> <span class="st0">&quot;/<span class="es4">$disabled_regexp</span>/&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>




And a few passing tests is better than none, right?

<pre>
$ <kbd>php ./symfony test:functional frontend customError</kbd>
# get /default/error404
ok 1 - status code is 404
ok 2 - request parameter module is default
ok 3 - request parameter action is error404
ok 4 - response selector body matches regex /webmaster@mycompany/
# get /default/disabled
ok 5 - status code is 200
ok 6 - request parameter module is default
ok 7 - request parameter action is disabled
ok 8 - response selector body matches regex /xXXXX/
1..8
 Looks like everything went fine.
</pre>
</li>

</ol>

<p>Sheesh, it&#8217;s still a little too involved for such a small benefit.  If anyone has any ideas on how to streamline this procedure, let me know!  Maybe it could be a plugin or an enhancement to symfony?</p>

<ul>
<li>Disabling projects only works if the <a href="http://www.symfony-project.org/book/1_1/19-Mastering-Symfony-s-Configuration-Files#chapter_19_sub_default_modules_and_actions"><code>check_lock</code>  option</a> is enabled in e.g. <var>apps/frontend/config/settings.yml</var></li>
</ul>

<p>** Symfony 1.0 default templates are found in <var>&#8230;/symfony/data/modules/default/templates/</var> and include an &#8216;unavailable&#8217; template in addition to &#8216;disabled&#8217;.  Symfony 1.2 templates are in the same place as in 1.1.</p>

<p>*** Symfony 1.2 wants its 500 error page in <var>config/error/error.html.php</var></p>
]]></content:encoded>
			<wfw:commentRss>http://n8v.enteuxis.org/2009/03/completely-custom-symfony-error-pages/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fix for slashes hosing Symfony URLs</title>
		<link>http://n8v.enteuxis.org/2009/02/fix-for-slashes-hosing-symfony-urls/</link>
		<comments>http://n8v.enteuxis.org/2009/02/fix-for-slashes-hosing-symfony-urls/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 22:54:31 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[Figuring IT Out]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://n8v.enteuxis.org/?p=117</guid>
		<description><![CDATA[I found this information in this forum topic, &#8220;Slash in parameter&#8221; which references this ticket, but had snags and wanted to write it all up cleanly here. The Problem Sometimes a parameter in a GET string contains slashes, which are interpreted as file path delimeters by Apache and/or parameter name/value separators by Symfony. So this [...]]]></description>
			<content:encoded><![CDATA[<p>I found this information in <a href="http://forum.symfony-project.org/index.php/m/41010/">this forum topic, &#8220;Slash in parameter&#8221;</a> which references <a href="http://trac.symfony-project.org/ticket/1482">this ticket</a>, but had snags and wanted to write it all up cleanly here.</p>

<h3>The Problem</h3>

<p>Sometimes a parameter in a GET string contains slashes, which are interpreted as file path delimeters by Apache and/or parameter name/value separators by Symfony.</p>

<p>So this URL works:
<samp>http://myapp/employee/bytitle/title/System+Engineer</samp></p>

<p>But this one returns a 404 (Page Not Found) error:
<samp>http://myapp/employee/bytitle/title/Programmer/analyst</samp></p>

<h4>Wrong solution</h4>

<p>Double-escaping the slash into &#8216;%252F&#8217; (e.g. <code>urlencode(str_replace('/', "%2f", $this-&gt;getTitle()))</code>) works <strong>if the URL isn&#8217;t rewritten by Apache</strong>.</p>

<p>This threw me because my URLs would work if they included the name of the controller file, <var>frontend_dev.php</var> or <var>backend.php</var> or even <var>index.php</var> like
<samp>http://myapp/<strong>index.php</strong>/employee/bytitle/title/Programmer%252Fanalyst</samp>,</p>

<p>but they wouldn&#8217;t work through the implicit, controllerless URLs  like
<samp>http://myapp/employee/bytitle/title/Programmer%252Fanalyst</samp></p>

<h3>Right solution</h3>

<p>Both</p>

<ol>
    <li>Turn on the <a href="http://httpd.apache.org/docs/2.2/en/mod/core.html#allowencodedslashes"><var>AllowEncodedSlashes</var> Apache directive</a> by adding this line to your server-wide section or the appropriate VirtualHost:
<pre> AllowEncodedSlashes On</pre>
<strong>AND</strong>,</li>
    <li><strong>DON&#8217;T</strong> double-escape the parameter as above, but do use <var>urlencode()</var> or equivalent to change slashes to <code>%2F</code>, eg. in the view layer,


<div class="wp_syntax"><div class="code"><pre class="php"><span class="kw2">&lt;?php</span> <span class="kw1">echo</span> link_to<span class="br0">&#40;</span>
    <span class="re0">$employee</span><span class="sy0">-&gt;</span><span class="me1">getTitle</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>
    <span class="st_h">'/employee/bytitle?title='</span><span class="sy0">.</span>
    <a href="http://www.php.net/urlencode"><span class="kw3">urlencode</span></a><span class="br0">&#40;</span><span class="re0">$employee</span><span class="sy0">-&gt;</span><span class="me1">getTitle</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
<span class="br0">&#41;</span><span class="sy0">;</span>  <span class="sy1">?&gt;</span></pre></div></div>



</li>
</ol>

<h4>Additional Complication</h4>

<p>Browsers may treat the encoded slash in the URL differently.</p>

<p>IE 7, 8 and Firefox 3, and Safari 3.2.1 on Windows display the URL in the address bar with the %2F intact, as you&#8217;d expect.</p>

<p>In Google Chrome 1.0.154.43, the links work but the address bar displays a slash instead of the encoded %2F, so if you hit the &#8220;Go&#8221; button you get a 404 error.  Weird.  Bug submitted!</p>
]]></content:encoded>
			<wfw:commentRss>http://n8v.enteuxis.org/2009/02/fix-for-slashes-hosing-symfony-urls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

