title: How to replace special character in HTTP request URI?
body: <p>On a Zend Framework 2 based website (test environment on nginx and live environment on Apache) there is a category "courses" and its pages have URIs like this:</p>
  
  <pre><code>domain.tld/courses/123-Name of course that can contain ®, €, (, ), and other special chars
  </code></pre>
  
  <p>The courses names come from the database and are URL-encoded for the internal links:</p>
  
  <pre><code>domain.tld/courses/123-Name%20of%20course%20that%20can%20contain%20%C2%AE%2C%20%E2%82%AC%2C%20%C3%A4%2C%20(%2C%20)%2C%20and%20other%20special%20chars
  </code></pre>
  
  <p>It's working fine, but when I try to access a page using a special character without encoding a 404-error occures.</p>
  
  <p>An example of website, that uses spacial characters is Wikipedia. You can use</p>
  
  <pre><code>http://en.wikipedia.org/wiki/Signal_(electrical_engineering)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>http://en.wikipedia.org/wiki/Signal_%28electrical_engineering%29
  </code></pre>
  
  <p>and are always get the page you want.</p>
  
  <p>Does someone know, how to achieve such behavior ("à la Wikipedia")? (Maybe with HTTP redirecting with a <code>.htaccess</code> rule?)</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p><strong>/etc/nginx/ax-common-vhost</strong></p>
  
  <pre><code>server {
      listen   80;
      server_name
          foo.loc
          bar.loc
          baz.loc
      ;
  
      if ($host ~ ^(?&lt;project&gt;.+)\.(?&lt;area&gt;.+)\.loc$) {
          set $folder "$area/$project";
      }
  
      access_log /var/log/nginx/$area/$project.access.log;
      error_log /var/log/nginx/error.log;
  
      gzip on;
      gzip_min_length 1000;
      gzip_types text/plain text/xml application/xml;
  
      client_max_body_size 25m;
  
      root /var/www/$folder/public/;
  
      try_files $uri $uri/ /index.php?$args;
      index index.html index.php;
  
      location / {
          index index.html index.php;
      sendfile off;
      }
  
      location ~ (\.inc\.php|\.tpl|\.sql|\.tpl\.php|\.db)$ {
          deny all;
      }
  
      location ~ \.htaccess {
          deny all;
      }
  
      if (!-e $request_filename) {
          rewrite ^.*$ /index.php last;
      }
  
      location ~ \.php$ {
        fastcgi_cache        off;
        #fastcgi_pass        127.0.0.1:9001;
        fastcgi_pass         unix:/var/run/php5-fpm.sock;
        fastcgi_read_timeout 6000;
        fastcgi_index        index.php;
        include              fastcgi_params;
        fastcgi_param        SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param        APPLICATION_ENV development;
        fastcgi_param        HTTPS $https;
    }
  }
  </code></pre>