title: How to redirect index.php to another page via htaccess
body: <p>I want to redirect any request coming on <code>www.url.com</code> to <code>www.url.com/error/error</code> except only <code>www.url.com/payment/payment</code>.</p>
  
  <p>I mean <code>www.url.com/payment/payment</code> request only should work.</p>
  
  <p>How it is possible?</p>
  
  <pre><code># .htaccess #
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::$
  RewriteRule ^(.*)$ - [E=BASE:%1]
  RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
  </code></pre>