Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
RewriteCond excluding domain

I'm struggling with my RewriteCond in .htaccess

I have to redirect 301 all my domains (domain1.com ; domain2.com ; domain3.com) to a single domain (x1x1x1.com) except 1 (domain4.com)

Do I have to use RewriteCond to exclude domain4.com or can I exclude it immediately in the RewriteRule ?

I've tried:

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain4\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.domain4\.com [NC]

RewriteRule ^(.*)$ https://x1x1x1.com/ [R=301,L]

</IfModule>

Thx all

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

something like this...

<IfModule mod_rewrite.c>

RewriteEngine On 
RewriteCond %{HTTP_HOST} !domain4.com [NC]
RewriteRule ^ https://x1x1x1.com/

</IfModule>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!