htaccess file for sending sub.domain

r.benmansour

Beginner
Hello,
I need help with a .htaccess config
I have 2 IPs and 2 domains, domainA is for mumara and domainB is sending domain on an other server or IP,
I want that all tracking goes with .htaccess and I have done that with success
the seconde part is I want once my client notice the tracking link "click.domainB"and want to check the main domainB it shows them the content of domainB and not direct them to domainA "mumara service"
I created this code but it's not working can any one check with me ??
============
Options +FollowSymLinks
RewriteEngine On

# Redirect all subdomains of [domain] (except [domain] itself) to the third-party tracking system for processing
RewriteCond %{HTTP_HOST} ^(www\.)?(.+\.)[domain]]\.{domain extantion}$ [NC]
RewriteRule ^(.+)$ http://[domain]]/$1 [L]

# Serve content from [domain] (excluding subdomains)
RewriteCond %{HTTP_HOST} ^[domain]]\$ [NC]
RewriteRule ^ - [L]
====================================
 
It appears that the tracking subdomain and the main domain are hosted within the same directory, which is not the ideal setup. For optimal performance and organization, we recommend configuring a separate subdomain dedicated to tracking. This allows for customization of the subdomain's selector/prefix to suit your specific needs or constraints. To implement this, you should direct your tracking subdomain to a distinct folder and place the .htaccess file within that folder to ensure it functions independently, thereby establishing a more structured and effective tracking environment.
 
Back
Top