用户
 找回密码
 入住 CI 中国社区
搜索
查看: 5300|回复: 11
收起左侧

Apache中的mod_rewrite

[复制链接]
发表于 2011-6-14 16:31:26 | 显示全部楼层 |阅读模式
本帖最后由 xushre 于 2011-6-14 16:32 编辑

我也不知道哪儿不对了,反正就是去不了index.php。
我的服务器是Apache2.2,windows平台,PHP5.2.6,MySQL5.5,index.php就在网站的根目录,按照论坛及网上搜索出来的方法测试,都不行。请哪个朋友给讲讲啊。这个东西郁闷了我快两天了!烦死人了


或者直接传一份你们的Apache的配置文件给我慢慢研究吧
发表于 2011-6-14 17:13:49 | 显示全部楼层
本帖最后由 jeongee 于 2011-6-14 17:15 编辑

试试把config文件里的$config['uri_protocol']的值改成下面的
$config['uri_protocol']        = 'ORIG_PATH_INFO';或者你可以试试xampp
 楼主| 发表于 2011-6-14 17:16:33 | 显示全部楼层
还是不行
发表于 2011-6-14 19:15:55 | 显示全部楼层
我的也是哦,公司的1.73正常的啊,家里自己搭的环境,不知哪里出了问题。htaccess的 rewrite启用后就400错误了
 楼主| 发表于 2011-6-14 22:02:42 CI中国手机版 | 显示全部楼层
和我这边一样,挺郁闷的
发表于 2011-6-15 09:00:06 | 显示全部楼层
APACHE 2.X里有个vhost.conf文件,看看这个文件里边的配置。
 楼主| 发表于 2011-6-15 09:21:28 | 显示全部楼层
设置是对的啊,我是照着网上的一模一样设置的,但还是不行哦
 楼主| 发表于 2011-6-15 09:46:08 | 显示全部楼层
本帖最后由 xushre 于 2011-6-15 10:21 编辑

我解决了,把Apache里面配置的地方发上来给大家
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/webservice/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.  
#

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    #Order deny,allow
    #Allow from all
    #Satisfy all
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "D:/webservice/htdocs">
    #
    # 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 Includes ExecCGI
    #
    # 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 All
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>


配置里面红色的部分 AllowOverride All 为必须,其他的配置都可以不要的,我已经测试过了,运作正常!

里面蓝色的是我的虚拟目录路径
发表于 2011-9-25 22:13:00 | 显示全部楼层
我的是因为 相对路径搞错了  
我重命名了一个相对路径
发表于 2011-9-29 10:57:25 | 显示全部楼层
有时候是路径问题。{:soso_e100:}

本版积分规则