【发布时间】:2014-01-15 13:54:14
【问题描述】:
我需要在 Codeigniter 中用Apache mod-rewrite 重写 URL
页面名称是example.com/pages/page1
我需要将其重命名为example.com/welcome.html
我在 htaccess 文件中写了这个规则
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^pages/page1$ welcome.html [PT,L]
它不起作用。我该怎么做?
【问题讨论】:
-
那么如果你直接去
example.com/welcome.html会不会出现问题? -
我使用了 Codeigniter "Routing" ellislab.com/codeigniter/user-guide/general/routing.html 我做了我需要的:)
标签: regex apache .htaccess codeigniter mod-rewrite