after becoming aware of the major lag that hits my site becaouse of the homepage redirect, i read into numerous optimization threads, proving that a 301 redirect slams out approximately 100ms to a staggering 400ms out of the total load time. On my website its around 250ms. Silly i know! On the other hand i really do need a redirect to the default language, because other domains for the different languages. What i have works, but wastest 250ms every single time.
Is there anyway this can done be faster?
Through htaccess rewrite perhaps?
CURRENTLY HAVE index.php
<?php
switch($_SERVER["HTTP_HOST"]){
case "site.org":
header('HTTP/1.1 301 Moved Permanently');
header('Location: /en/home'); # extensio .php is hidden: 'home' is a file
case "site.fr":
header('HTTP/1.1 301 Moved Permanently');
header('Location: /fr/home'); # extensio .php is hidden: 'home' is a file
etc etc
?>
I HAVE TRIED
Simply including home
that works for the first homepage beautifully, BUT the url in the browser is in this way NOT set to site.org/en/home
you just see the site.org
and all links then dont work anymore. What i need is that the homepage loads AND the url in the browser becomes /xx/home
Any and all clues are very appreciated +1