Linux Server in Apache hidden index.php failed

Source: Internet
Author: User

You can hide the app's portal file through URL rewriting index.php , which is the configuration reference for the relevant server:

"Apache"

    1. The mod_rewrite.so module is loaded in the httpd.conf configuration file
    2. AllowOverride none Changes none to all (PS: none of all allowoverride corresponding to all)
    3. Save the following content as a. htaccess file in the same sibling directory as the application portal file
<ifmodule mod_rewrite.c>+followsymlinks-%{request_filename}-%{request_ FILENAME}-^ (. *) $ index.php?/$1 [qsa,pt,L]</IfModule>

all of the above has been completed, after restarting Apache or failed, because the configuration in the "httpd-vhosts.conf" with include does not change to allow URL rewriting.

Just add

DocumentRoot "f:/wamp/www/test"ServerName www. Test. comserveralias admin. Tpshop. Comdirectoryindex index. HTML index.htm Index. phpoptions followsymlinksallowoverride noneOrderAllow,denyallow from all

Change into

DocumentRoot "f:/wamp/www/test"ServerName www. Test. comserveralias admin. Tpshop. Comdirectoryindex index. HTML index.htm Index. phpoptions followsymlinksallowoverrideall Orderallow,denyallow from all

Then save and restart Apache.

Linux Server in Apache hidden index.php failed

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.