简体   繁体   中英

.htaccess multiple domain redirect to one wordpress site

Search all internet, try many redirect versions, but no one works for my wordpress site.

Ok! I have 3 domains:

  • www.domain1. lv (this is a default domain)
  • www.domain2.eu (these two are new domains)
  • www.domain3.eu

When i go to domain1 it opens http://www.domain1.lv/lat/ (default language page). So, when i go to domain2 or domain3 i want that it opens http://www.domain2or3.eu/eng/ (english site version). If it not possible, it can redirect to http:// www.domain1.lv/eng/

At the moment, when i open new links, it redirects to default domain with some strange random page in it..

My .htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

在您的域2或域3 htaccess中,放入

     Redirect 301 / http://www.domain2or3.eu/eng/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM