php AND subdomain name
1) To setup a domain to have a catch-all style will be to open your apache's httpd.conf file and for the domain which you want to set to be catch-all you can put this
ServerAlias *.your-domain-name.com
if you donot have access to your httpd.conf directly then you might be able to edit apache parameters for your domain in your cpanel and even if that is not possible then you can simply send an email to your support team to enable catch-all on your domain.
2) .htaccess code will be needed as you ll proceede with the creation of pages, mostly it would be needed to make your dynamic pages look static to your visitors and to bots. for example
you might need to have a page
user1.yourdomain.com/user-profile.html
instead of saying user1.yourdomain.com/user-profile.php?user=user1
RewriteEngine On
RewriteRule ^([^/]+)/?.htm$ showpage.php?page=$1 [L]
RewriteRule ^([^/]+)/?.html$ showpage.php?page=$1 [L]
The above code will capture all .html and .htm file requests to your domain or subdomain and it will send the pagename which was requested to your file showpage.php
you can retrieve pagename in your showpage.php like
$page=$_REQUEST['page'];
then you can call your functions as i mentioned earlier to show this page.
Once your catch-all setup is done we will proceede with setting up these things. and please be assured that even if by any means you do not get any access to apache's configuration, even then we can find a way to sort this out.
When there is a Will, There is a way.
Cheers
ขึ้นไปด้านบน
