Page 1 of 1
Aliases Subdomain
Posted: Mon Aug 07, 2017 6:53 am
by desrat_sari
example I create domain >>
http://domain.com
If I want to create a subdomain url >>
http://domain.com/profile.php?nim=123456789
Aliases
http://subdomain.domain .com
What i must do??
Re: Aliases Subdomain
Posted: Tue Aug 08, 2017 8:41 am
by skurudo
If you want create subdomain, just add subdomain as domain
like subdomain.domain.com
If you want some weird redirect, just do it with htaccess or something like this.
Re: Aliases Subdomain
Posted: Wed Aug 09, 2017 1:15 am
by desrat_sari
@skurudo: yes , I mean redirect url >>
http://domain.com/profile.php?nim=123456789 to subdomain 123456789.domain.com? What i must do?? use .htaccess
Re: Aliases Subdomain
Posted: Wed Aug 09, 2017 10:02 am
by tjebbeke
You can do it in many ways I think. in .htaccess, in php, ...
In php you need to do something like this:
Code: Select all
<?php
header('location http://' . $_GET['nim'] . '.domain.com');
?>
Do not forget to validate the field first.
Re: Aliases Subdomain
Posted: Thu Aug 10, 2017 3:33 am
by desrat_sari
Where I should add this script?
page index?
In php you need to do something like this:
Code: Select all
<?php
header('location http://' . $_GET['nim'] . '.domain.com');
?>
Do not forget to validate the field first.[/quote]
Re: Aliases Subdomain
Posted: Fri Aug 11, 2017 2:37 pm
by tjebbeke
In the profile.php script where you handle the request.