【发布时间】:2012-05-15 01:55:03
【问题描述】:
我正在使用 codeigniter 框架重新开发一个网站。
当我们上线时,我们希望确保将一些旧网址重定向到新网站上的相应页面。
所以我将我认为正确的规则放入现有的 htaccess 文件中,置于 CodeIgniter 应用的其他规则之上。
但是,它们没有生效。谁能建议我在这里缺少什么?
# pickup links pointing to the old site structure
RewriteRule ^(faq|contact)\.php$ /info/ [R=301]
RewriteRule ^registration\.php$ /register/ [R=301]
RewriteRule ^update_details\.php$ /change/ [R=301]
# Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^_system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
# This snippet prevents user access to the application folder
# Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^myapp.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
# This snippet re-routes everything through index.php, unless
# it's being sent to resources
RewriteCond $1 !^(index\.php|resources)
RewriteRule ^(.*)$ index.php/$1
【问题讨论】:
标签: codeigniter mod-rewrite url-rewriting