search

Home  >  Q&A  >  body text

Apache configures rewrite to hide thinkphp's index.php

apache configures rewrite to hide thinkphp’s index.php?
I enabled the rewrite module

Listen 8888

<Directory />
    AllowOverride all
    Require all denied
</Directory>

<Directory "E:/wamp64/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options All

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require local
</Directory>

<VirtualHost *:8888>  
    #配置访问跟目录  
    DocumentRoot "e:/wamp64/www/golorryService"  
    ServerName http://127.0.0.1:8888
</VirtualHost>

What's wrong?

迷茫迷茫2742 days ago845

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-24 11:35:27

    http://doc.thinkphp.cn/mobile...

    reply
    0
  • PHP中文网

    PHP中文网2017-05-24 11:35:27

    Thanks for the invitation!

    Hide index.php, you should configure the .htaccess file under your e:/wamp64/www/golorryService

        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php/ [QSA,PT,L]
        

    And you need to confirm whether your apache’s httpd.conf (under the apache/conf directory) loads the mod_rewrite.so module

        LoadModule rewrite_module modules/mod_rewrite.so
    
        

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-24 11:35:27

    You can refer to this article for some configurations of Apache

    reply
    0
  • Cancelreply