80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
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>
80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
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]
80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mattmatt88 says

anyone?

80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
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.

80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mattmatt88 says

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

80 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by