63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

Hello.

I use two domains for my website (for two different languages). e.g. mypage.com -> english mypage.de -> german

the problem is that for the second domain, the htaccess rules doesn’t work (to remove the www in the domain).

Do you have an idea, how I can change the code to make it work?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

I think I would need a code like the following. But how can I combine it with the standard htaccess code above?

RewriteCond %{HTTP_HOST} ^www.mypage.com$ [NC]
RewriteRule ^(.*)$ http://mypage.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.mypage.de$ [NC]
RewriteRule ^(.*)$ http://mypage.de/$1 [R=301,L]
63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

anyone?

63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

still have no solution.

I use WPML. It works with the main domain to automatically remove the www. But the www isn’t removed for domain for the second language.

63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

no one ever had a page where he uses one domain per language?

63 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
mattmatt88 says

It worked with that code. Is that ok according to performance etc.?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST}  ^www.mypage.us [nocase]
RewriteRule ^(.*)         http://mypage.us/$1 [last,redirect=301]
RewriteCond %{HTTP_HOST}  ^www.mypage.co.uk [nocase]
RewriteRule ^(.*)         http://mypage.co.uk/$1 [last,redirect=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
by
by
by
by
by
by