Removing .html extension via .htaccess .htaccess How do you remove a .html extension or any extension using an .htaccess file? Best Answer Google is your friend :-) Take a look at this article. Code: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html Credit: http://eisabainyo.net/weblog/2007/08/19/removing-file-extension-via-htaccess/ Related SolutionsHtaccess rewrite and auth conflict As I answered here, I've solved this by simply creating an 401.html file for 401 errors. Php – Enable PHP extension within .htaccess It's exactly the same syntax as Apache's httpd.conf, so it's: LoadModule php_soap modules/php_soap.so (for the "modules" bit, I'm assuming you're using the normal modules directory from /etc/httpd. If not, put that directory in it's place.) (Wrong) It's not a module, as I'd originally thought, but a php extension. Extensions have the following syntax: extension=soap.so (also wrong) Apparently it's: php_extension soap.so Got that from this thread in a Drupal forum. Ymmv. I'm going home now, since clearly my brain is shot for the day. Also, make sure you allow for override, or the webserver will ignore your .htaccess file. Related TopicQuery string after .html in htaccess doesn’t work.why.htaccess isn’t workingPhp – .htaccess redirect all extension to phpPhp – Removing php extension with .htaccess does not workFixing 500 Error When Using Apache Rewrite Rules in .htaccess to Remove .html
Best Answer
Google is your friend :-)
Take a look at this article.
Code:
Credit: http://eisabainyo.net/weblog/2007/08/19/removing-file-extension-via-htaccess/