CodeIgniter Forums
301 redirects - 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 (/showthread.php?tid=47869)



301 redirects - El Forum - 12-26-2011

[eluser]gordon Stewart[/eluser]
Hello.

I have 3-4 URL's (domains) that all display the one website.

Where is the best place / file I can edit, to

a) detect if the user is showing the incorrect URL

and

b) create the 301 / META redirect. (also tell Google to only index the one site...)

EG :-

http://www.site1.domain.cpom/
http://www.site2.domain.com/
http://correctdomain.com/


http://www.correctdomain.com/

all 4 sites show the same content, but I want users / web indexes (google) to display / use the last one - www.correctdomain.com/



I can use the meta HTTP-EQUIV="REFRESH" tag in my head area, but I'm wondering where the best way/file is to detect the incorrect URL, & pass it to my header-file/template..