Cannot access addon domain via domain name

sibirac

Registered
Mar 24, 2020
4
0
1
Serbia
cPanel Access Level
Website Owner
Hi guys,

Please Assist as I am lost.

I have main domain (examples):

example1.rs

I added another domain example2.rs.
Since I created new document root (/public.html/example2) I had to created addon domain and subdomain example2.example1.rs.

Now when I want to access website on example2.rs I cannot, I can only access it via example2.example1.rs

How can access site just via example2.rs?
 
Last edited by a moderator:

sibirac

Registered
Mar 24, 2020
4
0
1
Serbia
cPanel Access Level
Website Owner
Thanks for quick reply.

On many sites I read it should be automatic but for me it is not. I tried couple of times.

In .htaccess I have


RewriteEngine on

RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^example2\.rs$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example2\.rs$
RewriteRule ^/?$ "https\:\/\/example2\.rs\/" [R=301,L]
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
That rewrite should just redirect example2.com or www.example2.rs to https://example2.rs so I don't foresee it causing this issue - trying to perform a curl request for the original domains you added and I noticed that neither of them seem to resolve. When you perform a curl request for the addon domain as follows:

Code:
curl -vvI domain.rs
what is the output? (ensure you remove any identifying information before adding here)
 

sibirac

Registered
Mar 24, 2020
4
0
1
Serbia
cPanel Access Level
Website Owner
Hi, many thanks for helping me out


* Rebuilt URL to: example2.rs/
* Trying 195.252.xxx.xxx...
* TCP_NODELAY set
* Connected to example2.rs (195.252.xxx.xxx) port 80 (#0)
> HEAD / HTTP/1.1
> Host: example2.rs
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Server: nginx
Server: nginx
< Date: Tue, 24 Mar 2020 19:48:34 GMT
Date: Tue, 24 Mar 2020 19:48:34 GMT
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Content-Length: 227
Content-Length: 227
< Connection: keep-alive
Connection: keep-alive
< Location: https://example2.rs/
Location: https://example2.rs/
< Set-Cookie: _mcnc=1; Max-Age=2; Path=/
Set-Cookie: _mcnc=1; Max-Age=2; Path=/
< X-Microcachable: 0
X-Microcachable: 0
< Set-Cookie: uid=w/xutF56ZBJfrzxhAwuaAg==; expires=Thu, 23-Apr-20 19:48:34 GMT; domain=$host; path=/
Set-Cookie: uid=w/xutF56ZBJfrzxhAwuaAg==; expires=Thu, 23-Apr-20 19:48:34 GMT; domain=$host; path=/
< P3P: policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"
P3P: policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"

<
* Connection #0 to host example2.rs left intact
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
That's resolving the domain without issue (not the subdomain) - Can you confirm that the same thing occurs when you go to the domain over https or when you remove the redirect?

To confirm, has the new domain been issued an SSL certificate?
 
  • Like
Reactions: sibirac