Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how to direct a subdomain to a sql data

Featured Replies

Hello friends,

 

I have a membership site where members will submit their data and choose a template to display their information. On this site, I want each member to have his own subdomain (eg membername.mysite.com) whereby anybody that enter the subdomain into the address bar will be directed to the template the person has chosen and the member's data will be collected from the database and displayed. A very good example is how articles that are summited are being view on WWW.BLOGSPOT.COM (eg myblog.blogspot.com)

 

Regards

adsegzy

You will first need to get a wildcard set for subdomains in you DNS Zone file *.yourdomain.com as a cname to your main domain

Then its just a case of using a htaccess file to redirect any domains that aren't www or without the www to go to the desired script you want to run to work out the individual username

  • Author

You will first need to get a wildcard set for subdomains in you DNS Zone file *.yourdomain.com as a cname to your main domain

Then its just a case of using a htaccess file to redirect any domains that aren't www or without the www to go to the desired script you want to run to work out the individual username

 

Am sorry for asking too much, but if you dont mind can you pls give me an example (how to go about coding the DNS Zone file). assuming my domain is www.mysite.com and i want a subdomain for a member named mike to that the subdomain reads www.mike.mysite.com?

plssssssssssssssssssssssssssss

You can't "code" a DNS zone file - If you have access to it with your domain or with your hostings name servers you can do it that way, otherwise you will need to contact your hosting in order to get the record added (ask them to verify that all subdomains will redirect to your site)

 

From there, it's just a case of using the .htaccess file to check if the current host is www.yoursite.com. If it isn't redirect to your script. Something like this as a .htaccess file should work (untested)

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.example.com$

RewriteCond %{HTTP_HOST} !^example.com$

RewriteRule .* /path/to/script.php[L]

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.