开启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问题解决了。
开启Apache mod_rewrite模块(解决404 Not Found)的更多相关文章
- 开启Apache mod_rewrite模块完全解答
启用mod_rewrite模块 在conf目录的httpd.conf文件中找到 LoadModule rewrite_module modules/mod_rewrite.so 将这一行前面的#去掉. ...
- 【转】开启Apache mod_rewrite模块完全解答
启用mod_rewrite模块在conf目录的httpd.conf文件中找到LoadModule rewrite_module modules/mod_rewrite.so将这一行前面的#去掉.2.在 ...
- Ubuntu系统启用Apache Mod_rewrite模块
在终端中执行 sudo a2enmod rewrite 指令后,即启用了 Mod_rewrite 模块. 另外,也可以通过将 /etc/apache2/mods-available/rewrite.l ...
- 启用Apache Mod_rewrite模块
Ubuntu 环境 在终端中执行 sudo a2enmod rewrite 指令后,即启用了 Mod_rewrite 模块. 另外,也可以通过将 /etc/apache2/mods-available ...
- apache缺少模块解决方法
找到一台老古董机器 [root@resource conf]# cat /etc/redhat-release CentOS release 5.6 (Final) [root@resource co ...
- windows开启Apache的mod_rewrite模块
windows下安装apache默认是没有开启mod_rewrite模块的,启用也很简单,修改apache配置文件httpd.conf,查找rewrite_module, 找到这行:#LoadModu ...
- Ubuntu Apache配置及开启mod_rewrite模块
刚刚将服务器系统从CentOS换成Ubuntu,将MySQL,Apache,PHP和Wordpress安装好后,发现打开主页是正常的,但是打开文章页面时出现错误.因为使用了自定义的固定链接设置,那自然 ...
- apache开启url rewrite模块
在把服务器数据转移到本地服务器之后,本地打开首页出现排版紊乱等问题,经过大神指点说是url rewrite的问题. 本篇文章主要写怎样开启apache的url rewrite功能. 打开Apache2 ...
- APACHE 服务器开启URL REWRITE模块的方法
最近做wordpress,发现固定链接总是设置不了.后来发现是由于apache服务器的URL REWIRITE模块没有开启导致. 查询了资料之后终于设置成功,记录下步骤: 1:开启apache的url ...
随机推荐
- wxPython学习笔记(三)
要理解事件,我们需要知道哪些术语? 事件(event):在你的应用程序期间发生的事情,它要求有一个响应. 事件对象(event object):在wxPython中,它具体代表一个事件,其中包括了事件 ...
- 2013级C++第15周(春)项目——输入输出流及文件文件操作
课程首页在:http://blog.csdn.net/sxhelijian/article/details/11890759.内有完整教学方案及资源链接 本周程序阅读及程序调试中须要的文件,请到htt ...
- linux 启动network后报错:device eth0 does not seem to be present, delaying initialization
问题背景: 在vsphere client中部署ovf模板后启动linux 的network后提示:device eth0 does not seem to be present, delaying ...
- Maven实战——生命周期和插件
Maven的构建过程包含:初始化.编译.測试.打包.集成測试.部署 Maven拥有三套相互独立的生命周期:clean(清理项目).default(构建项目).site(建立项目网站) 每一个生命周期包 ...
- [转] PostgreSQL的时间/日期函数使用
PS:http://blog.csdn.net/love_rongrong/article/details/6712883 字符串模糊比较 日期类型的模糊查询是不能直接进行的,要先转换成字符串然后再查 ...
- Java基础知识强化26:Object类之hashCode()方法、getClass()方法
1. Object类的hashCode()方法,如下: public int hashCode():返回该对象的哈希码值,这个值和地址值有关,但是不是实际地址值(哈希码值是根据实际地址值转化过来的 ...
- 源码搭建lnmp平台
lnmp平台是指利用linux操作系统,nginx服务器,mysql数据库和php语言搭建高性能web服务器,负载均衡器和邮件代理服务器. 原理图:‘
- 95秀-ViewPager 使用实例
Activity的样式 <style name="under_live_indicator" parent="android:Theme.NoTitleBa ...
- 03-StreamReader和StreamWriter的案例
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...
- EF code first 生成edmx文件
通过下面的代码,你就可以拿到EF心中的地图 —— edmx文件. using (var context = new Context()) { XmlWriterSettings settings = ...