0
我正在使用codeigniter框架重新開發一個網站。使用mod_rewrite重定向舊的URL與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