php - Removing file extensions in .htaccess with wordpress -
i have static website running in conjunction wordpress in same dir, works fine. however, on static pages don't use wordpress cannot seem remove .php file extensions .htaccess file looks this:
# begin wordpress <ifmodule mod_rewrite.c> errordocument 404 /index2.php rewriteengine on rewritebase /index.php/ rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress #alternate default index page directoryindex index2.php errordocument 404 http://example.com/index2.php
i have tried adding code wont work:
rewriteengine on rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l]
try this
rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php [l]
Comments
Post a Comment