Ubuntu开启.htaccess的支持
Yourtion 创作于:2013-09-06
全文约 509 字,
预计阅读时间为 2 分钟
Ubuntu下启动Apache对.htaccess 的支持步骤:
- 终端运行
sudo a2enmod
程序提示可供激活的模块名称,输入:
其中rewrite
- 修改
/etc/apache2/sites-enabled/000-default(该链接指向的是站点配置文件)
把(默认的www目录、或者需要应用.htaccess的目录)下的AllowOverride 属性改为All,保存。
- 重新加载
apache
sudo /etc/init.d/apache2 restart
附xampp的ModRewrite开启方法:
要开启Mod Rewrite功能其实是很简单的:
- 在你的
XAMPP安装目录下找到httpd.conf这个文件( 位于\etc\httpd.conf) - 用vim或其他文本编辑器打开它
- 找到 “
AllowOverride None”, 替换为”AllowOverride All“。(修改第一个就可以了) - 再找到”
#LoadModule rewrite_module modules/mod_rewrite.so“,把前面的”#”号去掉 - 重启
XAMPP
然后Mod Rewrite功能就开启了:)