There is a landing page with 2 pages index.html and en.html. How to make the simplest CNC so that on the English version of the landing page there was a URL of the type / en

Closed due to the fact that the essence of the question is incomprehensible by the participants αλεχολυτ , tutankhamun , Grundy , Streletz , aleksandr barakin 24 Sep '16 at 7:55 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • What exactly does not work? - tutankhamun

1 answer 1

.htaccess file:

 RewriteEngine on RewriteBase / #Don't favicon! RewriteCond %{REQUEST_FILENAME} !^favicon\.ico RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) index.php?$1 [L,QSA] 

Now you need to parse $_SERVER['REQUEST_STRING']; and pass the necessary parameters to the script that handles this whole thing, or you can simply take $_GET['param'] .

$_GET['param'] is the file you need to connect

Like this:

 switch ($_GET['param']) { case 'param_1': //или 'index' // выполняем нужные функции/методы break; case 'param_2': // выполняем нужные функции/методы break; } 
  • Who plus the answer with an error? :) - Visman
  • @Visman why with an error? So far everything works for me :) - Rosnowsky
  • Where did you get $_GET['param'] ? - Visman
  • @Visman probably from the query string. Perhaps you are complaining about RewriteRule ^(.*) index.php?$1 [L,QSA] ?) Should be RewriteRule ^(.*) index.php?view$1 [L,QSA] and then it will be $_GET['param'] . So? - Rosnowsky