简体   繁体   中英

cant hide php extension in .htaccess file Apache Web Server

I try to hide extensions of php files and hide PHP files for safety. 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. Need your help thank you. Any help is appreciated. I in web hosting provider bluehost if some one know how to do that. thx

my htaccsess is:

# 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

    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. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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