title: Remove .php from URL
body: <p>Ubuntu 14.04LTS 32bit</p>
  
  <p>LAMP</p>
  
  <p>I know it's an old question but..</p>
  
  <p>I need it to remove .php anywhere it finds it from the visible url.
  It needs to work with /showthread.php?id=XX ---> /showthread?id=XX</p>
  
  <p>I can't even get it to work with <code>/page.php</code> --> <code>/page</code>.
  I've tried these:</p>
  
  <p><a href="https://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess">Remove .php extension with .htaccess</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1992183/how-to-hide-the-html-extension-with-apache-mod-rewrite">How to hide the .html extension with Apache mod_rewrite</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15917258/remove-php-from-urls-with-htaccess">Remove .php from urls with htaccess</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13832468/how-to-stop-htaccess-loop/13832827#13832827">How to stop .htaccess loop</a></p>
  
  <p>It just does nothing at all.
  While other <code>.htaccess</code> code works fine..</p>
  
  <p>While</p>
  
  <pre><code>&lt;?php 
  phpinfo();
  </code></pre>
  
  <p>Lists mod_rewrite in Loaded Modules</p>
  
  <p>And</p>
  
  <pre><code>&lt;?php
   if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
   $res = 'Module Unavailable';
   if(in_array('mod_rewrite',apache_get_modules())) 
   $res = 'Module Available';
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;body&gt;
  &lt;p&gt;&lt;?php echo apache_get_version(),"&lt;/p&gt;&lt;p&gt;mod_rewrite $res"; ?&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Returns <code>Module Available</code></p>
  
  <p>Tried many more things</p>
  
  <pre><code># Apache Rewrite Rules
   &lt;IfModule mod_rewrite.c&gt;
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
  
  # Add trailing slash to url
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
    RewriteRule ^(.*)$ $1/ [R=301,L]
  
  # Remove .php-extension from url
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^([^\.]+)/$ $1.php 
  
  # End of Apache Rewrite Rules
   &lt;/IfModule&gt;
  </code></pre>
  
  <p>#</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{SCRIPT_FILENAME} !-d
  RewriteRule ^([^\.]+)$ $1.php [NC,L]
  </code></pre>
  
  <p>#</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule ^(.*)$ $1.php
  </code></pre>
  
  <p>Not even this has any effect whatsoever:</p>
  
  <pre><code>RewriteRule ^page$ page.php [L]
  </code></pre>
  
  <p><code>sudo service apache2 restart</code> does not change anything.</p>
  
  <p>Server reboot changes nothing.</p>
  
  <p>I tried clearing other code inside, did not make any change.</p>
  
  <p>I cleared my browser cache 100 times</p>
  
  <p>I'm starting to think that it just hates me. What could possible be causing this??</p>