Wilcard Subdomain

Started on the old forum in January 2010 · view the original in the archive · old links redirect here

5 replies · 708 views · started 16 years ago · 1 min read

5 participants
marduck Junior · 12 posts #1

how to create a subdomain with wilcard for lavalair scripts, such as in twiter example, users will have their own subdomain I've done it like a proper setting wordpresMU, but always failed, is it possible to have extra files in the index.php?

LavalairLavalair.com

cs.spot123 Junior · 27 posts #2

Create a file ..

profile.php?user=admin

in profile.php..

$user = $_GET[user']

for my_sql_query .. For name = $user fetch querys from ibwf_users user shout counts, snaps, scraps etc..

Now try viewing : profile.php?user=admin

If it works fine..

Now go to .htaccess and use following code..

RewriteEngine On
RewriteRule ^([^/]+).html profile.php?user=$1 [NC]

So profile.php?user=admin becomes sitename.com/admin.html

Similarly u can even have admin.sitename.com for that enable wild card...

Go to cpanel.. -> Subdomain options.. Create a new subdomain using "*" (Star) .. * stands for wild card.

and edit htaccess 😉 Hope it helps

ori Lead · 512 posts #3

if u have (master) reseller with root access or dedicated u can enable wildcards with no script code required

GiLL Senior · 356 posts #4

look this is best wild card dns setting if you have dedicate server or your server administer can do it for you
and you don't need put any thing in .htaccess file as well as you don't need even rewrite rules just put few code in your index which will check user in data base and send him on valid place do everything it self

Setting up Wildcard DNS for Subdomains on Cpanel

left wap stuff

marduck Junior · 12 posts #5

cs.spot123 wrote: Create a file ..

profile.php?user=admin

in profile.php..

$user = $_GET[user']

for my_sql_query .. For name = $user fetch querys from ibwf_users user shout counts, snaps, scraps etc..

Now try viewing : profile.php?user=admin

If it works fine..

Now go to .htaccess and use following code..

RewriteEngine On
RewriteRule ^([^/]+).html profile.php?user=$1 [NC]

So profile.php?user=admin becomes sitename.com/admin.html

Similarly u can even have admin.sitename.com for that enable wild card...

Go to cpanel.. -> Subdomain options.. Create a new subdomain using "*" (Star) .. * stands for wild card.

and edit htaccess 😉 Hope it helps

I use scripts lavalair and I've settng dns cpanel on my webhost manager saya dudah membuat .htaccess

RewriteEngine On
RewriteRule ^([^/]+).html profile.php?user=$1 [NC]

after I tried to call username.mydomain.com There is no website configured at this address. please explain more detailed steps to lavalair / webdesire scripts

LavalairLavalair.com

Quintin Junior · 20 posts #6

marduck wrote: I use scripts lavalair and I've settng dns cpanel on my webhost manager saya dudah membuat .htaccess

RewriteEngine On
RewriteRule ^([^/]+).html profile.php?user=$1 [NC]

after I tried to call username.mydomain.com There is no website configured at this address. please explain more detailed steps to lavalair / webdesire scripts

I use wildcard dns on my site, and my coding is as i want it, code my own script, but i can't seem to get my .htaccess file right to rewrite as username.html my script is http://user.site.com/sites/index.php?name=username

when you want to access the site, you just type into your browser, user.sitename.com then it redirects to the above adress.

header("location: hell.php");

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close