Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Aliases Subdomain

General questions about VestaCP
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
desrat_sari
Posts: 5
Joined: Thu Jun 02, 2016 2:11 am

Aliases Subdomain
  • Quote

Post by desrat_sari » Mon Aug 07, 2017 6:53 am

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??
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Aliases Subdomain
  • Quote

Post by skurudo » Tue Aug 08, 2017 8:41 am

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.
Top

desrat_sari
Posts: 5
Joined: Thu Jun 02, 2016 2:11 am

Re: Aliases Subdomain
  • Quote

Post by desrat_sari » Wed Aug 09, 2017 1:15 am

@skurudo: yes , I mean redirect url >>http://domain.com/profile.php?nim=123456789 to subdomain 123456789.domain.com? What i must do?? use .htaccess
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Aliases Subdomain
  • Quote

Post by tjebbeke » Wed Aug 09, 2017 10:02 am

desrat_sari wrote:@skurudo: yes , I mean redirect url >>http://domain.com/profile.php?nim=123456789 to subdomain 123456789.domain.com? What i must do?? use .htaccess
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.
Top

desrat_sari
Posts: 5
Joined: Thu Jun 02, 2016 2:11 am

Re: Aliases Subdomain
  • Quote

Post by desrat_sari » Thu Aug 10, 2017 3:33 am

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]
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Aliases Subdomain
  • Quote

Post by tjebbeke » Fri Aug 11, 2017 2:37 pm

In the profile.php script where you handle the request.
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password