1. 先加载mod_rewriter
在ubuntu 下 cgi 方式的 apache 下,先让mod_rewrite 生效
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
2. 在web 站点配置,
<directory "..."></directory>中有“allowoverride none” 改成 allowoverride FileInfo Options
3.在web根目录下加.htacess
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase/ RewriteCond $1 !^(index.php|flash|img|css|js|robots.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] </IfModule>
本文档详细介绍了如何在Ubuntu环境下使用Apache服务器进行URL重写配置。首先通过符号链接激活mod_rewrite模块,然后修改站点配置文件允许.htaccess覆盖,最后在.htaccess中设置Rewrite规则实现动态页面的静态化展示。
1262

被折叠的 条评论
为什么被折叠?



