php - Codeigniter: 301 redirect URLs from old site -
I recently launched a codeigniter website and need to create 301 redirects from the old site a new one. They will not work with regex, therefore, because there are only a few, I can write redirects for each page. However, after the hours / improvements of googling, I have no happiness yet. The URL of the old site are .html files, my codeigniter URL has "clean" url. Here is my current .htaccess file:
& lt; IfModule mod_alias.c & gt; 301 "/index.html" /index.php & lt; / IfModule & gt; & Lt; IfModule mod_rewrite.c & gt; DirectoryIndex index.php # This redirect is on RewriteEngine. I'm trying to work RewriteRule ^ / about-us.html /index.php?/about-us [R = 301, L] RewriteCond $ 1! ^ (Index \ .php | index |. Html | lib | robots \ .txt) revittals ^ (. *) $ Index.php? / $ 1 & lt; / IfModule & gt; Any ideas?
You can use:
revised rule ^ (approx. - us). Html $ /index.php?/$1 [R = 301, NC, L, QSA] or all old .html links to redirect: < / P>
Rewrite rule ^ (. +?). HTML $ /index.php?/$1 [R = 301, NC, L, QSA] Edit: Depending on the comments, you This rule is required to keep the old rules in mind:
Rivet condom% {THE_REQUEST} \ s / + (. +?) \. [Html]
Comments
Post a Comment