Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-29, 12:02:14

Author Topic: wildcard * subdomain  (Read 2828 times)

0 Members and 1 Guest are viewing this topic.

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
wildcard * subdomain
« on: 2014-07-02, 03:46:35 »
Adding a wildcard A record to dns fails with:

Alert: Invalid subdomain *

How to add a wildcard A record?  I want to use htaccess to redirect to sub directories, using:
Code: [Select]
# if we have not already rewritten this request to a subdomain-subdirectory
RewriteCond %{ENV:REQ_SUBDOMAIN} ^$
# and if valid hostname, get requested subdomain into local variable %2
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9][-a-z0-9]+)\.example\.com(:80)?$ [NC]
# and if the requested subdomain is not "www"
RewriteCond %{HTTP_HOST} !^www\.example\.com
# and if the subdirectory for this subdomain exists
RewriteCond %{DOCUMENT_ROOT}/addons/%2 -d
# then rewrite the request to the subdirectory, set the loop-prevention variable, & quit for this pass
RewriteRule (.*) /addons/%2/$1 [E=REQ_SUBDOMAIN:%2,L]

But need dns to resolve all * .example.com.  It is my understanding this is a A record.  Also setting priority after other set A records?
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wildcard * subdomain
« Reply #1 on: 2014-07-02, 08:49:15 »
Add in 'server alias'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix

Page created in 0.025 seconds with 18 queries.

web stats analysis