.htaccess Sub-Domain URL Masking

Замовник: AI | Опубліковано: 13.01.2026

I need a concise .htaccess file that keeps the browser address bar fixed on sub.yourdomain.com while quietly serving the content that actually lives at http://ip-address:30000/. Scope • The masking applies only to the root of the sub-domain. Sub-folders (e.g., sub.yourdomain.com/anything-else) must remain untouched and continue to work exactly as they do now. No blanket redirects for every path—just the main entry point. Deliverable • A single, copy-ready .htaccess snippet with the correct RewriteEngine / mod_rewrite directives to achieve the above, tested for both HTTP and HTTPS access. Acceptance • Typing sub.yourdomain.com shows my content from ip-address:30000/ while the address bar still reads sub.yourdomain.com. • Navigating to any existing sub-folder still displays its own native content without being forced to the masked target. That’s all that’s required; once verified on my staging server, the job is complete.