Remove index.php on the Apache server access mode

Source: Internet
Author: User

On the Apache server access way to remove index.php below I say Apache, how to remove the URL inside the index.php
For example: Your original path is: Localhost/index.php/index
The changed path is: Localhost/index

The mod_rewrite.so module is loaded in the 1.httpd.conf configuration file//configured in Apache
#LoadModule rewrite_module modules/mod_rewrite.so To remove the siren from the front.

2. Configure in Apache to change the allowoverride none inside to allowoverride all

Note: Be sure to restart the Apache service after you modify it.

3. Ensure that the Url_model is set to 2 (URL rewrite mode)

Write in the project's configuration file

Return Array (
' Url_model ' = ' 2′,
);
4. htaccess files must be placed in the directory with

This file adds:


Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [L]

Add: Windows cannot create. htaccess, I'll say next. Create a method
Create a new file, then open it, click Save As (file type Select all) so you can

Oh, the rest is your own to test, hurriedly to try to

Remove index.php on the Apache server access mode

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.