【问题标题】:cant hide php extension in .htaccess file Apache Web Server无法在 .htaccess 文件 Apache Web 服务器中隐藏 php 扩展名
【发布时间】:2012-03-06 15:24:43
【问题描述】:

为了安全起见,我尝试隐藏 php 文件的扩展名并隐藏 PHP 文件。 所有的努力都没有给我带来我想要的结果,我在挣扎。 也许我错过了一些小事,可能是缺乏知识,我不知道。

我更改了文件的内容。 Htaccess 各种内容,我没有得到结果。 需要你的帮助谢谢。 任何帮助表示赞赏。 如果有人知道如何做到这一点,我在网络托管服务提供商 bluehost。 谢谢

我的 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>

或.htaccess

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

【问题讨论】:

    标签: php web hosting web-hosting


    【解决方案1】:

    我按照这些思路写了一篇文章,将 html 处理为 php,或者换句话说,将 .html 页面处理为 .php。希望我能理解您的问题,这篇文章可以解决这个问题。 你可以在这里阅读它 http://jaspreetchahal.org/html-as-php-htaccess/

    【讨论】:

      猜你喜欢
      • 2013-03-13
      • 1970-01-01
      • 1970-01-01
      • 2014-03-29
      • 2017-10-06
      • 2014-01-18
      • 1970-01-01
      • 2012-01-12
      • 2014-03-31
      相关资源
      最近更新 更多