Good afternoon,
I have a site that needs to have the English version, so I thought I had a folder / eng / and just change that url, but the site in Portuguese already uses htacess to have a friendly url that inside the normal root pull the pages inside of a folder called / pages / and then I need to make it when it is in English it will pull inside the folder / eng / pages /.
I'm trying to do but it can not load the page in the right folder.
My .htacess
RewriteEngine On
RewriteRule %{REQUEST_FILENAME} !-f
RewriteRule %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_-]+)\/?$ index.php?page=$1 [NC,L]
RewriteRule ^eng/([a-z_-]+)\/?$ index.php?page=$1 [NC,L]
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>
My index
<?php
require 'header.php';
include $url.$page;
require 'footer.php';
?>
I have an argument that generates the variable $ page
$page = (isset($_GET['page']) and !empty($_GET['page']))? "pages/{$_GET['page']}.php" : "pages/home.php";
if (!file_exists($page)): $page = "pages/404.php"; endif;
If someone can give me a light, I thank them.