问题
how can i change all my php page to show as html page in the browser ?
What will be the file name when they will save a x.php file ?
回答1:
Try putting the following in a .htaccess file at the main directory of your site (public_html or www), or httpd.conf (or similar) if you aren't on shared hosting and have root access to the server:
RewriteEngine On
RewriteRule ^(.*)\.html$ $1.php
When someone tries to save the page, it will save as .html (they will never know it was really a .php file!)
来源:https://stackoverflow.com/questions/6035633/hide-or-change-page-extension-with-mod-rewrite