.htaccess to remove /index/ action from URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: .htaccess to remove /index/ action from URL (/showthread.php?tid=23071) Pages:
1
2
|
.htaccess to remove /index/ action from URL - El Forum - 09-29-2009 [eluser]Ben Edmunds[/eluser] The reason was that we had some old links floating around with the /index/ so the idea was that this would be a quick and easy solution to that problem. n0xie, I didn't even know about canonical tags (until now). That should work perfectly and is a better solution. Thank you. Thanks for your help everybody, sorry if I didn't make sense at first. .htaccess to remove /index/ action from URL - El Forum - 09-29-2009 [eluser]n0xie[/eluser] [quote author="Ben Edmunds" date="1254280721"]The reason was that we had some old links floating around with the /index/ so the idea was that this would be a quick and easy solution to that problem. [/quote] Aah now THAT makes sense. Now I see why you would do that. Well if you are worried you could always just write a rewrite rule. Off the top of my head (so probably not working) but just to give you an idea: Code: Rewriterule ^(.*)/index /$1 [R=301,L] It should be something like 'redirect all url's which end with /index to the same url without index'. .htaccess to remove /index/ action from URL - El Forum - 09-29-2009 [eluser]Ben Edmunds[/eluser] Glad that it makes sense now! A rewrite rule is what I was originally looking for but I couldn't seem to make it work. Ill play around with the code tomorrow. Thanks! |