Answer the question
In order to leave comments, you need to log in
Redirect from root to internal directory in Apache?
I am making a multilingual site. At the same time, I store different versions of index pages in separate directories:
1. mysite.com/en/index.php - English index
2. mysite.com/en/index.php - Russian index
How to properly redirect a user who is trying to request a path: mysite .com to mysite.com/en/index.php ??? What to write in .htaccess ?
... and an additional question: What else needs to be considered in this case?
Answer the question
In order to leave comments, you need to log in
Found how to do it
RewriteEngine On
RewriteRule ^$ /newdir [L]
At the same time, I store different versions of index pages in separate directories.This is bad, there should be only one entry point.
Agree with OnYourLips . Before it's too late - change the architecture. Because it will get worse. There is only one entry point, one file, and according to routing - we define locale and draw a page with the necessary translation. Imagine you will have 5 languages, and you will need to change the picture or index.php structure, you will have to climb into all locales and change all files. It's a very crooked architecture. And if done correctly, you can simply set the default locale in the config (for example, ru), or even determine it automatically by the user's ip, for example, and you will not need to bind to Apache. The fewer connections the better, trust me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question