Jump to content

RewriteRule question


mark_nsx

Recommended Posts

Hi guys. I'm having problems with RewriteRule. Basically I have a sever with 1 static IP and several domains pointing to it (A records.). What I want to do is capture the domain name of those A records (i.e. www.sample.com) and rewrite it as subdomain of the main server (sample.maindomain.com) without altering the URL in the address bar. Here's what I got which isn't working:

 

RewriteEngine On
RewriteRule ^www.(.*).com$ http://$1.maindomain.com [L]

Link to comment
https://forums.phpfreaks.com/topic/164477-rewriterule-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.