i have installed wildcard on my server , and it’s working fine
i used this htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.org$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.org$ [NC]
when i open ( ddddddddddd.mydomain.com ) ,, i find my ( public_html files )
and That’s exactly what i want
but here is small problem
i want know the requested subdomain by php
Example :
dadadadadad.mydomain.com
How i can know the ‘dadadadadad’ ?
BY PHP
With PHP you can use
$_SERVER['HTTP_HOST']. It should returndadadadadad.mydomain.com. If you want only the subdomain part, here is the code: