Hide or Change page extension with mod_rewrite

2019-09-11 00:14发布

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条回答
何必那么认真
2楼-- · 2019-09-11 00:50

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!)

查看更多
登录 后发表回答