Jump to content

Recommended Posts

Posted

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 !

Posted

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.

Posted

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)

 

Posted

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

Posted (edited)

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
updated
Posted

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.

Posted

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

Posted

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 ?

Posted

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/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...