Forum Moderators: phranque
Preferably without the client seeingIf you rewrite, the client won't see anything. That's the definition of a rewrite as distinct from a redirect.
and place the index.html and supporting images etc in that folder and it will automatically just workNow you need to be careful, because if the browser "thinks" it is at example.org/ (which is to say example.org/index.html) then it will request supporting files on that basis. So the visitor will request example.org/images/prettypicture.jpg when it really needs example.com/example.org/images/prettypicture.jpg. In other words everything would need to be rewritten, not just the front page.
^(?:www\.)?([\w-]+\.com)and then you plug that captured %1 into the target. That's assuming there will never be other subdomains involved, just with/without www.
you probably want to use mod_proxy
www.<whatever.com>/<something>
www.<whatever.com>/<whatever.com>/<something>
But there doesn't seem to be any change in host here?
Basically we setup a lot of new sites with various platforms so I am using haproxy with the help of an ACL to redirect all hosts listed in a file to a specific backend server...
if i understand your description properly
[edited by: phranque at 3:34 am (utc) on Oct 8, 2017]
[edit reason] unlinked urls [/edit]
Any domains in that "redirect" file will simply be forwarded to an specific apache server dedicated to serving up coming soon pages.
So lets say that the Document Root for that same apache server is /var/www/html then we would simply create a folder under it /var/www/html/x.k12.in.us and place an index.html and supporting files there and it would automagically server up the proper files.
^(?:www\.)?([\w-]+\.com)
^(?:www\.)?(.*)/$ RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*)$ /%1/$1 [L]
RewriteCond %{HTTP_HOST} ^(.+) [NC]
RewriteRule ^(.*)$ /%1/$1 [L] RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . / RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?:www\.)?([\w-]+) [NC]
RewriteRule . /%1/index.html [L] It would pull out the $1 (www.) and $2 (x.com) for me but the $2 would only work for .com and not any of the others.