Php - Seo language redirect in index

I am going to publish a multilingual website with each language under a specific registry. (e.g. en /, fr /, it /, ru /) ....

the site does not have an "index", but it should be automatically redirected to "en / index.php"

I know this can be done in hundreds of methods, but is there a good seo-friendly way to do this redirection?

I am currently using something simple:

<?
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: en/index.php" );
?> 

Is this the right choice (seo-friendly talk)?

Thank!

+3
source share
1 answer

This is probably good enough. You can even use mod_rewrite to redirect visitors without having to load index.php (saves HTTP requests):

RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /en/index.php [R=301,L]
+2
source

Source: https://habr.com/ru/post/1779989/


All Articles