Apache server to set up, you can hide HTML source code content

Source: Internet
Author: User
Tags php source code
Apache server How to set up, you can hide HTML source code content?
http://docs.php.net/manual/zh/intro-whatis.php

You can even set the Web server to allow PHP to handle all the HTML files, so that UserThere is no way to know what the server has done.

Problem:
1.




Html


echo "PHP";
?>




The above code.
The browser can view the HTML source code. However, you can only see the results of the PHP source code!

If you do not want the user to know the contents of the HTML source code.
Apache server, how to set?
PHP official Manual (Chinese), where is the description?

Share to:


------Solution--------------------
Do not let users know the content of HTML, then you are ready to let the user's browser know?
------Solution--------------------
3. By default, the Apache server will only resolve the suffix:. php files. Yes no?

You mean, even if it is similar to: 1.html Such an access URI, the client is right-click to select "View Source file", also do not see the last browser rendering source code? If so, then generally in the client settings, such as the most simple right-click screen or something.

4. How to change the Apache server configuration. Causes the Apache server to resolve the suffix:. html files?
Official PHP Manual (Chinese) What's the explanation?

The problems involved here are more complex.

Simply say that the HTML file does not have to parse, how to render is the browser thing. If you want HTML files to be parsed like PHP files and parsed in PHP syntax, then the MIME changes are involved. It is strongly not recommended for individuals to do so.

As you mentioned in your last post, I don't know what you're thinking ...

Apache will parse the PHP code and leave it to PHP5 's Apache module to parse it. In general, some results will be obtained from the PHP5 parsing module, and the entire file will be routed to the browser as an HTML format. That's the way.

If you change the suffix directly, the PHP code will not be parsed, the need for results are not available, there is no efficiency and burden;

If you really change the mime of the HTML file to the PHP application, then even if your HTML is pure HTML, you have to parse it through PHP and return it as it is, but it will be inefficient.

Anyway, I don't know what you're thinking. I hope my answer will be of help to you.

The last question I want to ask is, what is your PHP level? How can you ask how weird the problem is? If it's a beginner, don't ask the horn-pointed question, okay?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.