Hide or Change page extension with mod_rewrite

喜你入骨 提交于 2020-01-06 04:51:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!