开启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 ...
随机推荐
- open Session In View模式
首先看图说话: ****Open Session In View模式的主要思想是:在用户的每一次请求过程始终保持一个Session对象打开着*** 接下来就是代码: +++++++++++++++++ ...
- 705 - Slash Maze
By filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Her ...
- iOS_15_通过代码自己定义cell_微博UI
终于效果图: BeyondTableViewController.h // // BeyondTableViewController.h // 15_代码自己定义cell_weibo // // Cr ...
- Android中Application类用法
Application类 Application和Activity,Service一样是Android框架的一个系统组件,当Android程序启动时系统会创建一个Application对象,用来存储系 ...
- mysql中判断字段为空
mysql中判断字段为null或者不为null 在mysql中,查询某字段为空时,切记不可用 = null, 而是 is null,不为空则是 is not null select nulco ...
- Java基础知识强化27:Object类之toString()方法
1. Object类的toString()方法: public String toString():返回该对象的字符串表示 2. 案例演示: (1)Student类: package cn.itc ...
- 深入理解 CSS变形 transform(3d)
坐标轴 在了解透视之前,首先要先了解坐标轴.3D变形与2D变形最大的不同就在于其参考的坐标轴不同.2D变形的坐标轴是平面的,只存在x轴和y轴,而3D变形的坐标轴则是x.y.z三条轴组成的立体空间,x轴 ...
- boostrap预定义样式风格
预定义样式分为五种:primary(首选项).success(成功).info(一般信息).warning(警告).danger(危险),demo如下,设置不同的class展示不同的样式 <!D ...
- javascript 中寻找性能瓶颈
1.如果一个段代码很耗时的话你可以注释掉一部分你认为是很耗时的,或者干脆全部注释掉,然后再一点一点的解开. 2.js优化中最主要的还是对dom操作的优化,单纯的js执行时间是很短的,而js和dom之间 ...
- Jenkins学习之——(4)Email Extension Plugin插件的配置与使用
1.先安装插件 2.配置 点击高级后 内容配置: 3.项目配置 点击Advanced Settings后 到此所有的配置都设置完成. 附录: 以下内容来自其他网友的博客,内容也没有自己去试,朋友们可以 ...