开启Apache mod_rewrite模块(解决404 Not Found)

简介:

网站搭建完成了,进入登录界面就是访问不了。

原因大概是没有开启Apache mod_rewrite模块,或者没有配置完全。

步骤1:

启用mod_rewrite模块
在conf目录的httpd.conf文件中找到

LoadModule rewrite_module modules/mod_rewrite.so


将这一行前面的#去掉。

 

步骤2:

 

复制代码
<Directory "/var/www/myweb">

#
# 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 All

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

</Directory>
复制代码

步骤3:

重新启动apache

service httpd restart

如此便可以访问了页面了,.htaccess文件在所有的子页面都有效了。

404Not Found问题解决了。



本文转自TBHacker博客园博客,原文链接:http://www.cnblogs.com/jiqing9006/p/3277393.html,如需转载请自行联系原作者

相关文章
|
6月前
|
PHP Apache
PHP环境搭建(配置php模块到apache服务器)
PHP环境搭建(配置php模块到apache服务器)
62 0
|
1月前
|
Java 数据库连接 mybatis
解决Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: No constructor found
解决Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: No constructor found
82 1
|
29天前
|
存储 缓存 负载均衡
【Apache ShenYu源码】如何实现负载均衡模块设计
整个模块为ShenYu提供了什么功能。我们可以看下上文我们提到的工厂对象。/***/核心方法很清晰,我们传入Upsteam列表,通过这个模块的负载均衡算法,负载均衡地返回其中一个对象。这也就是这个模块提供的功能。
17 1
|
5月前
org.apache.ibatis.builder.BuilderException: An invalid property ‘jdbcType ‘ was found in mapping
org.apache.ibatis.builder.BuilderException: An invalid property ‘jdbcType ‘ was found in mapping
|
6月前
|
XML Java 数据库连接
【异常解决】解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
【异常解决】解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
107 0
|
8月前
|
XML 前端开发 Java
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
|
8月前
|
Apache
Apache域名跳转----配置rewrite模块
Apache域名跳转----配置rewrite模块
242 0
|
9月前
|
SQL Java 数据库连接
nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘‘ not found. Ava
用mybatis写注解SQL的执行报错,这个报错有很多原因就不说了,说一下我的问题 同一个mapper中方法有重名的,虽然编译没报错,相当于重载了,但是执行的时候就报错了 方法写的太多了都没注意
|
10月前
|
SQL XML Java
org.apache.ibatis.binding.BindingException: Parameter ‘startTime‘ not found. Available parameters
org.apache.ibatis.binding.BindingException: Parameter ‘startTime‘ not found. Available parameters
106 0
|
10月前
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
82 0

热门文章

最新文章

推荐镜像

更多