Jump to content


Photo

subdomain or alias


  • Please log in to reply
15 replies to this topic

#1 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 07 June 2021 - 12:18 AM

I have a subdomain on public_html : duo/

If I use subdomain from Cpanel I've got: duo.maena.heliohost...

I can do : maena.heliohost.us/duo/

Is it possible to redirect  maena.heliohost.us/duo/ into an alias like this : duo.heliohost.us/

If this is possible it would be very useful !

Thank you !



#2 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 22,444 posts
  • Gender:Male

Posted 07 June 2021 - 12:31 AM

You can use .htaccess to redirect people from a subdirectory to a subdomain. Post some actual subdirectory and subdomain names instead of examples and I can write some actual .htaccess code for you.



#3 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 07 June 2021 - 08:31 AM

Thank you !

I will check the htaccess after modification to learn how to do.

Where is the htacess file located in the ftp structure ?

The existing subdirectory is "duo".

1. Could you please redirect maena.heliohost.us/maena/ into this : maena.heliohost.us

2. Could you please redirect maena.heliohost.us/duo/ into this : duo.heliohost.us (no matter if alias 1 is not possible)

 



#4 Seekier

Seekier

    Rank IV Member

  • Members
  • PipPipPipPip
  • 244 posts
  • Gender:Male
  • Location:Nigeria

Posted 07 June 2021 - 08:49 AM

To make .htaccess visible you'll need to go Cpanel->file manager->setting
and enable hidden files and if you can't still see it, then create it but it must look look like .htaccess

I was here! 


#5 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 22,444 posts
  • Gender:Male

Posted 07 June 2021 - 02:33 PM

Put this in /home/maena/public_html/maena/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/maena/ [NC]
RewriteRule ^(.*)$ https://maena.heliohost.us$1 [R=301,L]
Put this in /home/maena/public_html/duo/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/duo/ [NC]
RewriteRule ^(.*)$ https://duo.heliohost.us$1 [R=301,L]
Obviously I haven't tested this so let me know if it doesn't work and we can try to figure out why.

Edited by Krydos, 08 June 2021 - 02:20 AM.
updated


#6 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 07 June 2021 - 05:49 PM

Thanks for the details !



#7 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 07 June 2021 - 08:54 PM

The 2 files have been put to the 2 correct paths.

However there is no success for the 2 url loading.

If you have the possibility to fix the 2 aliases that would be great because I don't have the knowledge for this.



#8 Seekier

Seekier

    Rank IV Member

  • Members
  • PipPipPipPip
  • 244 posts
  • Gender:Male
  • Location:Nigeria

Posted 07 June 2021 - 09:03 PM

But why don't you just go to domain in Cpanel, redirect it and be done with it. Beside it will create the redirect rules code in htaccess by itself

I was here! 


#9 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 22,444 posts
  • Gender:Male

Posted 08 June 2021 - 02:22 AM

I updated my answer above, and edited the files myself and it seems to work.
 
If you try to go to https://maena.heliohost.us/maena/ you end up at https://maena.heliohost.us/ now.

If you try to go to https://maena.heliohost.us/duo/ you end up at https://duo.heliohost.us/ now.

#10 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 08 June 2021 - 11:03 AM

Thank you, the 2 redirections are OK.

The redirection for duo works. But if the address is directly opened it returns "server not found".

The redirection works: https://maena.heliohost.us/duo/

The direct url does not work, "Server not found": https://duo.heliohost.us/

 

The goal of the alias is to be used as a direct address.

I tried on my side but could not get it work.
Could you please adapt the duo htaccess in order it to work as a direct address, so that https://duo.heliohost.us/  opens directly the page please ?

 

Maybe this is just the htaccess not loading the default pages ?



#11 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 22,444 posts
  • Gender:Male

Posted 08 June 2021 - 08:38 PM

I think the confusion is it's not duo.heliohost.us, it's duo.maena.heliohost.us.



#12 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 09 June 2021 - 06:58 PM

Hi,

Still: https://duo.heliohost.us/

Returns : "Server not found"

The folder contains an index.html that should load. (and .htaccess file that you created)

 

Pointing it : https://duo.heliohost.us/index.html

Returns : "Server not found"

 

Is it possible to use directly: https://duo.heliohost.us/

Where "duo" is a subdomain. Logically it requires some action on your server side, not in htaccess.

 

Please could this problem be solved before this week-end. I just need to type : https://duo.heliohost.us/

and to see the page loading. I suppose it's just a configuration on your server side.

Could you please make sure that it works this time ?

 

Subdomain: duo

Actually works: maena.heliohost.us/duo/

KO: duo.maena.heliohost.us (subdomain is created, but url does not load it)

KO: duo.heliohost.us/

Goal: https://duo.heliohost.us/



#13 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 22,444 posts
  • Gender:Male

Posted 10 June 2021 - 01:25 AM

You can only have one .heliohost.us subdomain at a time on your own as your main domain.



#14 maena

maena

    Newbie

  • Members
  • 8 posts

Posted 10 June 2021 - 07:47 AM

Yes it is possible, please see :

https://www.helionet...t/?hl=subdomain

 

Please can you escalate the topic for the subdomain duo to work like this :

Goal: https://duo.heliohost.us/

 

Please escalate to root admin:

duo.heliohost.org (or .us) must point to /home/maena/public_html/duo/

 

Thank you !



#15 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 13,958 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 10 June 2021 - 11:29 AM

Domain created. Give it a few hours and it should work assuming the .htaccess files are correct.


Please do not PM me for support. Posting on our forums lets all of us learn.
Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users