title: Unable to allow these characters in URL:- % / \ # +
body: <p><strong>About the system</strong></p>
  
  <p>I have URLs of this format in my project:-</p>
  
  <pre><code>http://project_name/browse_by_exam/type/tutor_search/keyword/class/new_search/1/search_exam/0/search_subject/0
  </code></pre>
  
  <p>Where <code>keyword/class</code> pair means search with "class" keyword.</p>
  
  <p>Following is my htaccess file:-</p>
  
  <pre><code>##AddHandler application/x-httpd-php5 .php
  
  Options Includes +ExecCGI
  Options +FollowSymLinks
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  
  ############To remove index.php from URL
  
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  #################################################end of find a class 
  
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I have a common index.php file which executes for every module in the project.
  There is only a rewrite rule to remove the index.php from URL (as you can see above).</p>
  
  <p>I am not using any htaccess rewrite rules for defining the $_GET array. I have a URL parser function in PHP inside which does that instead. For the example URL I gave, the parser returns:-</p>
  
  <pre><code>Array ( [a] =&gt; browse_by_exam [type] =&gt; tutor_search [keyword] =&gt; class [new_search] =&gt; 1 [search_exam] =&gt; 0 [search_subject] =&gt; 0 )
  </code></pre>
  
  <p>I am using urlencode() while preparing the search URL and urldecode() while reading the search URL</p>
  
  <p><strong>Problem</strong></p>
  
  <p>I am facing problems with some characters in the URL</p>
  
  <pre><code>Character               Response
  %                       400 - Bad Request - Your browser sent a request that this server could not understand.
  /                       404 - Not FOund
  \ # +                   Page does not break but urldecode() removes these characters.
  </code></pre>
  
  <p>I want to allow all these characters. 
   What could be the problem? How do I allow these?
  Please help
  Thanks,
  Sandeepan</p>
  
  <p><strong>Updates</strong></p>
  
  <p>Now only / character is causing URL breaking (404 error like before). So, I tried by removing the htaccess rewrite rule which hides the index.php in the URL and tried with complete URL instead. For a search term <code>class/new</code> I tried with the following two URLs:-</p>
  
  <pre><code>http://project_name/index.php?browse_by_exam/type/tutor_search/keyword/class%2Fnew/new_search/1/search_exam/0/search_subject/0
  
  http://project_name/index.php/browse_by_exam/type/tutor_search/keyword/class%2Fnew/new_search/1/search_exam/0/search_subject/0
  </code></pre>
  
  <p>And the first one works but the 2nd one does not. Notice the <code>index.php?browse_by_exam</code> in the first one. </p>
  
  <p>But I cant use the 1st URL convention. I have to make / work with index.php hidden. Please help</p>
  
  <p>Thanks again
  Sandeepan</p>
  
  <p><strong>Edit (Solved)</strong></p>
  
  <p>Considering Bobince's answer to my other question</p>
  
  <p><a href="https://stackoverflow.com/questions/3235219/urlencoded-forward-slash-is-breaking-url">urlencoded Forward slash is breaking URL</a>
  , I feel it is best to have URLs like this:-
  <code>http://project_name/browse_by_exam?type/tutor_search/keyword/class
  %2Fnew/new_search/1/search_exam/0/search_subject/0</code></p>
  
  <p>That way I get rid of the difficulty of readability caused by <code>&amp;param1=value1&amp;param2=value2</code> convention and also able to allow forward slashes in the query string part by using <code>?</code> </p>
  
  <p>I want to avoid AllowEncodedSlashes because Bobince said <code>Also some tools or spiders might get confused by it. Although %2F to mean / in a path part is correct as per the standard, most of the web avoids it.</code></p>