easyphp and .htaccess

孤者浪人 提交于 2019-12-03 20:19:07

Default installation of Apache in EasyPHP don't have activated the option to use .htaccess files to modify server configuration in folders.

You have to tell Apache what configuration can be changed with .htaccess files, and in which folder. To enable all config changes on main web server, you should edit http.conf (in Apache/conf folder), and look for:

<Directory "${path}/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.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

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

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

and change

    AllowOverride None

to

    AllowOverride All

To better fine tune it, read documentation about AllowOverride in: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

Also, check that http.conf has mod_rewrite activated, look for:

#LoadModule rewrite_module modules/mod_rewrite.so

And remove the leading "#"

LoadModule rewrite_module modules/mod_rewrite.so

When working on a local website I fixed this problem by adding the website path (with the .htaccess) as a virtual host. Easyphp has got a module for this: 'Virtual Hosts Manager'. This wil automatically take care of the httpd.conf.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!