1

We have a Wordpress Mutlisite running so I need do redirect the specific pages, categories and files only if a specific domain is requestet.

So when domain.de/allgemein is requestet it shoul redirect to domain.de/neues-von-der-domain but no if for example domain2.de/allgemein is requestet.

We use Domainmapping so all Domains have just one htaccess file.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domain.de$ [NC]    
RewriteCond %{REQUEST_URI} !^/allgemein    
RewriteRule domain.de/neues-von-der-domain/ [NC,L,R=301]

2 Answers2

1
RewriteEngine On

    RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com [NC]
    RewriteRule ^(.*)$ http://otherdomain.com/$1 [R=301,L]

Can also be used to redirect to a landing page based on the requested domain:

RewriteEngine On

    RewriteCond %{HTTP_HOST} ^www.domain.com
    Rewriterule ^(.*)$ http://www.any-domain.com/landing-page.html [L]
Ravi Patel
  • 5,121
  • 2
  • 25
  • 44
0
enter code here  <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

put this code in your .htaccess file