[Tutorial] is it possible to make a file without a. php extension executable script in the LAMP environment?

Source: Internet
Author: User
[Tutorial] is it possible to make a file without a. php extension a executable script in the LAMP environment: & lt ;? Phpecho & nbsp; 'Hello & nbsp; world! ';? & Gt; If it is stored as hw. php, of course everything works. If you [ask for advice] is it possible to make a file without a. php suffix executable script in the LAMP environment?
A simple example:

echo 'hello world!';
?>


If it is stored as hw. php, of course everything works.
If you save it as hw (without a suffix), visit http://www.domain.com/hwthrough a browser,
The source code is printed directly.

Is it possible to execute a file without a suffix like a common. php file.
------ Solution --------------------
You can configure to access the: http: // xxxxxxxx/webpage through a column directory.
------ Solution --------------------
Http://www.domain.com/hw

Hw in is generally the controller name in the mvc structure, or implemented through rewrite.
------ Solution --------------------
I am not very clear about what you mean

If you only need to hide the file name of the entry, you only need to do so.
RewriteCond % {REQUEST_FILENAME }! -D
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]
In this way, all scheduling is performed in index. php by analyzing $ _ SERVER ['path _ info '].
That is to say, a set of programs can manage all user directories.

If each user directory or several user directories require a separate website system. Copy the. htaccess file 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.