继续摘抄:Ubuntu系统启用Apache Mod_rewrite模块
2010-01-04 23:23
495 查看
Ubuntu系统启用Apache Mod_rewrite模块 |
时间:2007-11-19 17:53:22 来源:Linux联盟收集整理 作者: |
/etc/apache2/sites-available/default/default中的
AllowOverride None没有完全改过来,留了几个,而我又把booksystem从/home/****/www移到了/var/www/下,这下.htaccess文件不起作用了。
在终端中执行 sudo a2enmod rewrite 指令后,即启用了 Mod_rewrite 模块。
另外,也可以通过将 /etc/apache2/mods-available/rewrite.load 连接到 /etc/apache2/mods-enabled/rewrite.load 来打开 Mod_rewrite 模块。用指令操作就是:
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
一点小提示
事实上,当我在 Ubuntu 中采用上述做法并重启了 Apache 服务后,仍然无法正常 rewrite 网址。这里,还有一点需要注意的地方:
sudo vim /etc/apache2/sites-enabled/000-default
将其中的:
AllowOverride None
修改为:
AllowOverride All
上
面的 /etc/apache2/sites-enabled/000-default 实则为
/etc/apache2/sites-available/default 的连接。而 AllowwOverride None 则会完全忽略
.htaccess 文件,自然其中所定义的 rewrite 规则也就不能生效了。
最后,别忘了使用下列指令来重启 Apache:
sudo /etc/init.d/apache2 restart.
相关文章推荐
- Ubuntu系统启用Apache Mod_rewrite模块
- Ubuntu系统启用Apache Mod_rewrite模块
- Ubuntu系统启用Apache Mod_rewrite模块
- Ubuntu系统启用Apache Mod_rewrite模块
- Ubuntu系统下允许Apache的mod_rewrite功能
- Ubuntu Apache配置及开启mod_rewrite模块
- Ubuntu系统下允许Apache的mod_rewrite功能
- 启用Apache Mod_rewrite模块
- ubuntu启用apache的mod_headers和mod_expires
- Ubuntu系统启用Apache Mod_rewrite模块
- 电脑装多系统,启动出现grub rescue,“normal.mod not found”解决办法(windows,ubuntu)
- Linux apache 添加 mod_rewrite模块
- win7 ubuntu 双系统启动grub rescue模式,error:file "/boot/grub/i386-pc/normal.mod" not found
- Apache、 Tomcat、 Python、 Mod_Python、 Tilecache、 Geoserver 在Ubuntu下的搭建
- apache安装/编译mod_rewrite模块
- 转-Linux下Apache增加mod_rewrite模块
- 深入理解apache mod_rewrite模块
- ubuntu 启用apache运行状态信息查看
- Ubuntu 系统安装APACHE PHP MYSQL
- Ubuntu centos系统——apache如何解决跨域资源访问