Mhari Posted January 9, 2018 Posted January 9, 2018 Hi, I just want to automatically create a new subdomain in my domain for users that have registered and redirect it to example his profile (his username as a subdomain ex: username.mydomain.com) I have search tutorials for it and I found to add new A Record that use wildcard for name.i found in stackoverflow like shown below: Is heliohost support for this? I have setup it as below: this is my A Record and htaccess: and index file: and the result my browser got redirected in this page when I use https: and this page when I not use https: please any solution for this ?thanks for reading and answering
miwilc Posted January 9, 2018 Posted January 9, 2018 HelioHost uses cPanel, you'd need to manually add records. I recommend just creating a subfolder. <domain>/~<user>/ Wildcard DNS does not exist btw.
Krydos Posted January 9, 2018 Posted January 9, 2018 You could use a script to create the subdomain through cpanel.
Mhari Posted January 10, 2018 Author Posted January 10, 2018 it might could help. but actually i looking for the alternative of it. i mean if user register in my site he will have his own profile page address as a subdomain (like user.masaeng.ga) that not created in the cPanel but as another alias of my domain and i can easily costumize what will be dispayed there (and dynamic data such as users data) and does not require me to get into cpanel (also not fulling up my subdomain list in cpanel).please do you have any solutions for this case? such as directing in htaccess or whatever any help would be helpful for me
Krydos Posted January 10, 2018 Posted January 10, 2018 Try this guide https://www.inmotionhosting.com/support/edu/cpanel/cpanel-manage-domains/create-wildcard-subdomain It should be possible. I think you're missing the step where you create a subdomain through cpanel named *.
Mhari Posted January 10, 2018 Author Posted January 10, 2018 its working when i visit as (whatever).masaeng.ga but i not sure it is working properly because when i write php code there, the code was not run (it is displayed on the source page) also on that guide the code in .htaccess file in not available. then how i get it such as masaeng.ga/index.php?u=mhari as mhari.masaeng.ga any solution please
Krydos Posted January 11, 2018 Posted January 11, 2018 Try this guide then for the .htaccess https://stackoverflow.com/a/15334516
Mhari Posted January 12, 2018 Author Posted January 12, 2018 (edited) Hi,, I have tried above guide but i dont know why the php code are not run so i dont know it work or not. Are there any wrong step I did in creating subdomain ? Edited January 12, 2018 by Mhari
Krydos Posted January 12, 2018 Posted January 12, 2018 There you go http://krydos.masaeng.ga/ and http://hari.masaeng.ga/ To start php use this opening tag <?php Your code had <php Which is missing the ?
Mhari Posted January 12, 2018 Author Posted January 12, 2018 Oh my god.. thank you.. its now working properly then, is it possible to make it be https for each ?
maicol07 Posted January 12, 2018 Posted January 12, 2018 Hi,HTTPS will be automatically enabled in all domains/subdomain by CPanel AutoSSL, with a certificate issued by CPanel Inc. and trusted by all browsers. 1
wolstech Posted January 12, 2018 Posted January 12, 2018 I'm not sure how the subdomains are being implemented here. If they're actually being added to cPanel, maicol07 is correct, they'll get a certificate within 24 hours of creation. If they're implemented some other way, they might not.
Krydos Posted January 12, 2018 Posted January 12, 2018 You would have to buy a wildcard ssl certificate https://www.namecheap.com/security/ssl-certificates/wildcard.aspx?aff=102467 in order to cover all of your subdomains that aren't added to cpanel. If you created each subdomain through cpanel then autossl would cover each subdomain within 24 hours after creation.
Mhari Posted January 12, 2018 Author Posted January 12, 2018 Ok,, I just want to know. I think that's more than enough Thank you very much!
Mhari Posted January 13, 2018 Author Posted January 13, 2018 Hi, I am found a problem the urls after the domain are ignoredfor example main.masaeng.ga/haha/hihi/huhu/hoho.php will still in main.masaeng.ga/index.phpI mean whatever I write after the domain it would be ignored and show me index.php page. I think this problem appear because something wrong in my .htaccess file here is the file : RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{REQUEST_URI} !index\.php RewriteCond %{HTTP_HOST} ^(.+?)\.masaeng\.ga$ RewriteRule .* /index.php?u=%1 [L] anyone know what the wrong is?please tell me since I do not really understand the codethanks in advance
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now