Reputation: 83
My client has a webshop in 2 languages:
- my-website.be (Dutch + French)
- my-website.nl (Dutch)
I have to remake the /blog for these 3 languages using Wordpress.
I have no access to the main website and server, so this has to be done with reverse proxy.
Ideally this will look like this:
- my-website.be/nl-be/blog/%postname%/
- my-website.be/fr-be/blog/%postname%/
- my-website.nl/blog/%postname%/
We use WPML(pro) for translation on the website
I have to proof this is possible
I'm trying to proof this is possible with wpml + reverse proxy on my local machine using MampPro for Windows. (As I do not have real/live servers/domains available to test this) And this is not working correctly whatever I try.
my-site.localbe
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^nl-be/blog/(.*)$ http://my-site.test/$1 [P]
RewriteRule ^fr-be/blog/(.*)$ http://my-site.test/$1 [P]
</IfModule>
my-site.localnl
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^blog/(.*)$ http://my-site.test/$1 [P]
</IfModule>
==> with this setup both reverse proxy domain just show the default homepage and/or subpages. There's no way to access the other languages.
Overwriting the server_name variable in functions.php as follows:
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
Combinations and variations off all above.
Thanks a lot, a developer in distress
Upvotes: 1
Views: 303