301 redirects in .htaccess file - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: 301 redirects in .htaccess file (/showthread.php?tid=46260) |
301 redirects in .htaccess file - El Forum - 10-25-2011 [eluser]Unknown[/eluser] Hi, Please ignore spaces in links - for some reason I'm not allowed to use them! I have recently redesigned a website in CodeIgniter and would now like to be able to create 301 redirects from, for example, http:// www. somesite. com/ page.shtml?abc to http:// www. somesite. com/ xyz. I read somewhere that using Redirect 301 lines weren't a good idea because of all the RewriteRule lines already in my .htaccess file - getting rid of index.php and ensuring www is used, etc. So I am trying to redirect using this line, instead: Code: RewriteRule ^page.shtml?abc /xyz [R=301] I continue to get a 404 with this, so I don't think the first part of this RewriteRule is correct. I have tried moving the line to the top of the .htaccess file, so that the other RewriteRules aren't interfering, but I still get a 404. Here is my .htaccess in full: Code: RewriteEngine on The rest of the RewriteRule lines work as expected; it's only the 301s I am having trouble with. I would be very grateful if someone could help me find the solution. Many thanks in advance. |