Ask for advice, there is no possibility in the lamp environment to make no. php suffix name of the file becomes an executable script

Source: Internet
Author: User
Ask, is it possible to make a file without a. php suffix in the lamp environment executable script
To give a simple example:

echo ' Hello world! ';
?>


If saved as hw.php, of course everything is OK.
If saved as HW (no suffix), when accessing HTTP://WWW.DOMAIN.COM/HW through a browser,
The source code is directly printed out.

Excuse me, is it possible to let such a file without a suffix be executed like an ordinary. php file.
------Solution--------------------
Can be configured through a column-only directory Access: http://xxxxxxxx/the page is out.
------Solution--------------------
Http://www.domain.com/hw

The HW in is generally the controller name in the MVC structure, or implemented through rewrite.
------Solution--------------------
I don't know what you mean.

If you just want to hide the entry file name, then you just have to.
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
So all the schedules are index.php by analyzing $_server[' path_info ')
Which means a set of programs can manage all user directories.

If a separate site system is required for each user directory or for a few user directories. Then copy this. htaccess to the corresponding directory.
  • Related Article

    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.