简体   繁体   English

无法在.htaccess文件Apache Web服务器中隐藏php扩展名

[英]cant hide php extension in .htaccess file Apache Web Server

I try to hide extensions of php files and hide PHP files for safety. 为了安全起见,我尝试隐藏php文件的扩展名和隐藏PHP文件。 All efforts do not bring me the results I want and I'm struggling. 所有的努力都没有给我带来我想要的结果,我正在挣扎。 Maybe I missed something small could be having a lack of knowledge, I do not know. 也许我错过了一些小事,可能是缺乏知识,我不知道。

I change the contents of a file. 我更改文件的内容。 Htaccess all sorts of content and I do not get results. htaccess各种内容,我没有得到结果。 Need your help thank you. 需要您的帮助谢谢。 Any help is appreciated. 任何帮助表示赞赏。 I in web hosting provider bluehost if some one know how to do that. 我在网络托管提供商bluehost中,如果有人知道该怎么做。 thx 谢谢

my htaccsess is: 我的htaccsess是:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
<IfModule mod_rewrite.c>
# For security reasons, Option followsymlinks cannot be overridden.
#   Options +FollowSymLinks
   Options +SymLinksIfOwnerMatch
   Options +Indexes
   RewriteEngine On
   RewriteCond %{SCRIPT_FILENAME} !-d
   RewriteRule ^([^\.]+)$ $1.php [NC,L]
</IfModule>

or .htaccess 或.htaccess

    Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]

I wrote an article along those lines to process html as php or in other words process .html pages as .php. 我按照这些思路写了一篇文章,将html处理为php,或者将.html页面处理为.php。 Hopefully I understand your problem to which this article could be an answer. 希望我理解您的问题,本文可以为您解答。 You can read it here http://jaspreetchahal.org/html-as-php-htaccess/ 您可以在这里阅读它http://jaspreetchahal.org/html-as-php-htaccess/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM