Here's my plan for translating the website, could be absolutely wrong so do correct me:
.htaccess redirect -> x.com/y -> /y/index.php
Now, x.com/index.php has all of the files needed to render the tables from mysql and translation included.
x.com/index.php sample
<body>
<?php include_once("analyticstracking.php") ?><?php include_once("lang.php") ?>
<!-- Header -->
<a href="#fourth" class="button scrolly"><?php echo lang('f');?> </a>
<a href="#fifth" class="button scrolly"><?php echo lang('g');?></a>
<!-- First -->
<section id="first" class="main">
<header>
<div class="container">
<h2><img src="images/m9.png"></h2>
<p><?php echo lang('m'); echo lang('ba'); ?><br/>.
<section><center>
<?php include("m9.php") ?>
All of the includes mentioned here are in the x.com directory.
My plan is to do this on each language subdirectory for its index.php:
<body>
<--? get language file from language sub --> <?php include_once("lang.php") ?>
<--? get php from home --> <?php require ("../index.php") ?>
</body?>
So I only have to change 1 index.php file each time I need to change everything.
Is this at all a possibility?
This is my .htaccess if that matters:
RewriteEngine On
RewriteCond %{HTTP:Accept-Language} ^en [NC]
RewriteRule ^$ http://xcsgo.com/en[L,R=301]
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ http://xcsgo.com/de [L,R=301]
RewriteCond %{HTTP:Accept-Language} ^fi [NC]
RewriteRule ^$ http://xcsgo.com/fi [L,R=301]
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ http://xcsgo.com/fr [L,R=301]
RewriteCond %{HTTP:Accept-Language} ^sw [NC]
RewriteRule ^$ http://xcsgo.com/sw[L,R=301]
RewriteRule ^$ http://xcsgo.com/en [L,R=301]
The Php error I get:
PHP Fatal error: require(): Failed opening required 'http://x.comm/index2.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php54/lib/php') in /home/x/public_html/y/en/index.php on line 30
Changed the x.com/en php code to this:
<?php require("/home/y/public_html/x/index2.php") ;?>
<?php include_once("lang.php") ?>
and this is the error:
PHP Fatal error: require(): Failed opening required '/home/y/public_html/x/index2.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php54/lib/php') in /home/y/public_html/x/en/index.php on line 30