Jump to content

htaccess redirection to default language to reduce load time


Eutanasio

Recommended Posts

Hi,

I've done a GTmetrix test and found that the website wastes 1.4s only on redirections until the website starts loading the default language version of the website.

When you access the website through www.web.com it then redirects to web.com and then finally arrives to web.com/fr/

Would it be possible to force a shortcut using htaccess? with something like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mywebsite\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/fr/.*$
RewriteRule ^(.*)$ /fr/$1 [R=301,L]

Thanks!

Edited by Eutanasio (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...