Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 52 replies, has 2 voices.

Last updated by Mateus Getulio 11 months, 3 weeks ago.

Assisted by: Mateus Getulio.

Author Posts
July 11, 2024 at 12:39 pm #15935063

Marc

No, I threw away all files from AEDCenter.DE and also the AEDCenter.DE database. Apparently the database belong together. I will put back the backup now

July 11, 2024 at 12:42 pm #15935080

Marc

The database is almost restored now. Can you please take a look what could be wrong? A filled database for AEDCenter.De maybe?

July 11, 2024 at 12:44 pm #15935100

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I'm checking it, I'll let you know.

July 11, 2024 at 12:47 pm #15935105

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

It looks like the old credentials no longer work.

I'm enabling private fields for your next reply in case you need to create a new wp-admin user and share it.

July 11, 2024 at 10:01 pm #15937919

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Marc,

I checked it and by this time the DNS propagation should already have taken place.

If I try to access hidden link I see a forbidden error. This happens because this domain is somehow configured as an actual site with a webroot. When I access the site, the server it tells me the path to this site and since there's no entry point, like and index.html or index.php file, it gives a 403 forbidden error.

You can reach out to Cloudways support, but I believe that just removing the files for hidden link and pointing the DNS to the same IP won't work. You'd have to remove it entirely as app and add it just as an alias within the settings of hidden link

They explain it a bit more here:

hidden link

and here:

hidden link

In their own words:

If you have any additional domains associated with the same application, e.g., cloudways.co.uk or app.cloudways.icu, you can add them here by clicking Add Domain. These additional domains will be added as an alias.

Next, you need to make one of your domains a primary domain. Then, all the other domains will be added as an alias. You can learn about the differences between primary and alias domains.

This is something they're able to assist you better and pretty quick.

On the WPML side, everything is properly set up for it to work, as soon as it gets corrected on the hosting side, the language switch will start to work.

Please let me know.

July 12, 2024 at 11:46 am #15942196

Marc

I tested for hours with Cloudways support. We know now that it's a .htaccess problem

Is this code written to the .htaccess by WPML?

# Redirect all traffic from aedcenter.de to aedcenter.nl
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]

July 12, 2024 at 11:49 am #15942199

Marc

There's a conflict somewhere in the .htaccess. Can you see where?

# BEGIN WP Rocket
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>

# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>

# Since we’re sending far-future expires, we don’t need ETags for static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None

<IfModule mod_alias.c>
<FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$">
<IfModule mod_headers.c>
Header set X-Powered-By "WP Rocket/3.16.2.1"
Header unset Pragma
Header append Cache-Control "public"
Header unset Last-Modified
</IfModule>
</FilesMatch>

<FilesMatch "\.(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
<IfModule mod_headers.c>
Header unset Pragma
Header append Cache-Control "public"
</IfModule>
</FilesMatch>
</IfModule>

<IfModule mod_mime.c>
AddType image/avif avif
AddType image/avif-sequence avifs
</IfModule>
# Expires headers (for better cache control)
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 4 months"
ExpiresByType image/png "access plus 4 months"
ExpiresByType image/jpeg "access plus 4 months"
ExpiresByType image/webp "access plus 4 months"
ExpiresByType video/ogg "access plus 4 months"
ExpiresByType audio/ogg "access plus 4 months"
ExpiresByType video/mp4 "access plus 4 months"
ExpiresByType video/webm "access plus 4 months"
ExpiresByType image/avif "access plus 4 months"
ExpiresByType image/avif-sequence "access plus 4 months"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType font/ttf "access plus 4 months"
ExpiresByType font/otf "access plus 4 months"
ExpiresByType font/woff "access plus 4 months"
ExpiresByType font/woff2 "access plus 4 months"
ExpiresByType image/svg+xml "access plus 4 months"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Gzip compression
<IfModule mod_deflate.c>
# Active compression
SetOutputFilter DEFLATE
# Force deflate for mangled headers
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
# Don’t compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
</IfModule>
</IfModule>

# Compress all output labeled with one of the following MIME-types
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \
text/xml
</IfModule>
<IfModule mod_headers.c>
Header append Vary: Accept-Encoding
</IfModule>
</IfModule>

# END WP Rocket
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} facebookexternalhit [NC]
RewriteCond %{TIME_SEC} <30
RewriteRule ^ - [L]
# Allowing Access

RewriteCond %{HTTP_USER_AGENT} facebookexternalhit [NC]
RewriteRule ^ - [R=429,L]
# Block access for 30 seconds
</IfModule>

# Redirect all traffic from aedcenter.de to aedcenter.nl
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]

<IfModule mod_headers.c>
Header append Cache-Control "s-maxage=2592000"
</IfModule>

# BEGIN Imagify: webp file type
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
# END Imagify: webp file type

# BEGIN Imagify: avif file type
<IfModule mod_mime.c>
AddType image/avif .avif
</IfModule>
# END Imagify: avif file type

# BEGIN Imagify: rewrite rules for avif
<IfModule mod_setenvif.c>
# Vary: Accept for all the requests to jpeg, png, and gif.
SetEnvIf Request_URI "\.(jpg|jpeg|jpe|png|gif|webp)$" REQUEST_image
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Check if browser supports AVIF images.
# Update the MIME type accordingly.
RewriteCond %{HTTP_ACCEPT} image/avif

# Check if AVIF replacement image exists.
RewriteCond %{REQUEST_FILENAME}.avif -f

# Serve AVIF image instead.
RewriteRule (.+)\.(jpg|jpeg|jpe|png|gif|webp)$ $1.$2.avif [T=image/avif,NC]
</IfModule>

<IfModule mod_headers.c>
# Update the MIME type accordingly.
Header append Vary Accept env=REQUEST_image
</IfModule>
# END Imagify: rewrite rules for avif

# BEGIN Imagify: rewrite rules for webp
<IfModule mod_setenvif.c>
# Vary: Accept for all the requests to jpeg, png, and gif.
SetEnvIf Request_URI "\.(jpg|jpeg|jpe|png|gif)$" REQUEST_image
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Check if browser supports WebP images.
RewriteCond %{HTTP_ACCEPT} image/webp

# Check if WebP replacement image exists.
RewriteCond %{REQUEST_FILENAME}.webp -f

# Serve WebP image instead.
RewriteRule (.+)\.(jpg|jpeg|jpe|png|gif)$ $1.$2.webp [T=image/webp,NC]
</IfModule>

<IfModule mod_headers.c>
Header append Vary Accept env=REQUEST_image
</IfModule>
# END Imagify: rewrite rules for webp

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (SEOkicks|FriendlyCrawler|DataForSeoBot|wine-searcherbot|CriteoBot|gptbot|MJ12bot|SemrushBot|AhrefsBot|Dotbot|PetalBot|YandexBot|YandexImages|Proximic|GrapeshotCrawler|BLEXBot|Barkrowler|SeznamBot|fidget-spinner-bot|thesis-research-bot|Claudebot|Baiduspider|Bytespider) [NC]
RewriteRule ^ - [F]

#Begin Really Simple Security
Options -Indexes
#End Really Simple Security
# BEGIN WordPress
# De richtlijnen (regels) tussen "BEGIN WordPress" en "END WordPress" worden
# dynamisch gegenereerd en zouden alleen aangepast mogen worden via WordPress filters.
# Alle wijzigingen aan de richtlijnen tussen deze markeringen worden overschreven.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# MalCare WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>

# END MalCare WAF

July 12, 2024 at 11:51 am #15942211

Marc

I now try to implement this script found as a solution on the WPML website to the Functions.php file and hope it will fix the problem ...

add_filter('mod_rewrite_rules', 'fix_rewritebase');
function fix_rewritebase($rules){
$home_root = parse_url(home_url());
if ( isset( $home_root['path'] ) ) {
$home_root = trailingslashit($home_root['path']);
} else {
$home_root = '/';
}

$wpml_root = parse_url(get_option('home'));
if ( isset( $wpml_root['path'] ) ) {
$wpml_root = trailingslashit($wpml_root['path']);
} else {
$wpml_root = '/';
}

$rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);
$rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);

return $rules;
}

July 12, 2024 at 12:18 pm #15942292

Marc

I uncommented the following line in the .htaccess and everything seems to work except for selecting the HEIM (home) buttong to the page/root: hidden link.

# Redirect all traffic from aedcenter.de to aedcenter.nl
# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^(www\.)?aedcenter\.de$ [NC]
# RewriteRule ^(.*)$ hidden link [L,R=301]

# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^aedcenter\.de$ [NC]
# RewriteRule ^(.*)$ hidden link [L,R=301]

Adding this script to the to the functions.php file of the Hello Elementor Child theme, did not fix the problem:

add_filter('mod_rewrite_rules', 'fix_rewritebase');
function fix_rewritebase($rules){
$home_root = parse_url(home_url());
if ( isset( $home_root['path'] ) ) {
$home_root = trailingslashit($home_root['path']);
} else {
$home_root = '/';
}

$wpml_root = parse_url(get_option('home'));
if ( isset( $wpml_root['path'] ) ) {
$wpml_root = trailingslashit($wpml_root['path']);
} else {
$wpml_root = '/';
}

$rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);
$rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);

return $rules;
}

- Almost there, but how to finally fix this problem to have it work 100% ?

July 12, 2024 at 2:39 pm #15943075

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Marc,

Thank you so much for sharing the solution of the issue!

I tested the language switcher functionality and it looks like it is working 100% now?

Even the Heim button + menu link are working properly in the German version now.

July 12, 2024 at 3:03 pm #15943185

Marc

Everything seems to work EXCEPT for selecting the HEIM (home) button to the page/root: hidden link.

So almost there, but how to finally fix this aedcenter.de root problem to have it work 100% ?

Is this code written to the .htaccess by WPML?

# Redirect all traffic from aedcenter.de to aedcenter.nl
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^aedcenter\.de$ [NC]
RewriteRule ^(.*)$ hidden link [L,R=301]

July 12, 2024 at 8:06 pm #15944374

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Marc,

I'm not able to reproduce any issues, please check:

hidden link

Perhaps I'm testing it wrongly?

Regarding the htaccess, WPML writes in it as part of the language switcher system as it is explained a bit more here: https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

There's a workaround available in the link above to cease some of those changes.

July 13, 2024 at 5:08 am #15946208

Marc

Hi Mateus,

I also made a video showing that things are still not working. See: hidden link

Most Dutch pages are translated, so I can select GERMAN and I will see a page in German. Great, but then when I select HEIM the site will redirect me to hidden link. See my video. It really drives me nuts.

Can you please dive one last time into my WPML settings and my .htaccess if you see something that's not set-up well? Otherwise I see no other option then to rip both sites apart and to translate AEDCenter.DE manually. It's not what I want because it will cost a lot of (unpaid) time ...

Thanks and cheers,
Marc

July 13, 2024 at 10:28 am #15947060

Marc

Hi Mateus,

Unfortunately Mateus I decided to stop trying to fix this issue, although you really supported me superbly! It took me way too long (over a week) to get close to a working solution but my client can't wait anymore. The solution of the problem is somewhere to be found in the .htaccess.

So I decided to rip the alias apart and will host 2 separate websites and will do the translation by hand. It will take me a long time, but at least I have the translation more in my own hands 🙁

A big big thanks for all your time and effort,
Marc

July 14, 2024 at 1:45 pm #15950235

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Marc,

I'm sorry to hear about it. The process is usually simpler but we had some troubles in the way.

Good luck with the project and if you have any doubts or concerns be sure to let us know.

Cheers! =)

The topic ‘[Closed] WPML functionality’ is closed to new replies.