Help with subdomain and .htaccess

Web hosting discussion, programming, and shared and dedicated servers.
2 posts Page 1 of 1
by onyxrat » Thu Oct 08, 2020 5:18 pm
I need help configuring a subdomain.

I made changes to the DNS, but it appears my .htaccess file is not taking effect.

I was looking for instructions regarding the .htaccess file and I saw another post with this text: "follow the procedures indicated in the Sonic .htaccess help document (sections 5 and 6)" but I cannot find any such document with sections 5 and 6.

This other post is from Feb 2019: viewtopic.php?f=8&t=8429&p=43050&hilit= ... ess#p43050

I could find information on .htaccess here but nothing that matches the previous post: https://help.sonic.com/hc/en-us/article ... --htaccess


My procedures:
Create simple INDEX.HTML and .htaccess files. I used notepad on Windows 10 and I added a couple blank lines to the end of the .htaccess file.
Modify the DNS to create test.mydomain.com using the Sonic page "Modify Host Records".
Create a test subdirectory using WinSCP.
Put in a simple INDEX.HTML file using WinSCP.
Copy in the initial .htaccess file using WinSCP (with transfer mode "Text"). My file is created by notepad and I added a couple blank lines at the end.
Change the file permissions for .htaccess to 755.

I then do two tests (using Firefox as the browser)
http://www.mydomain.com/test correctly serves me the simple INDEX.HTML file.
http://test.mydomain.com gives me a default "This is the future home...Powered by sonic" page.

Help! I would love to find instructions that apply to my problems. I would settle for someone just giving me advice.

Here are the details of my changes (but I did change the actual user and domain names).


My addition using "Modify Host Records":
test.mydomain.com 7200 CNAME mydomain.com


My .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST] ^test.mydomain.com$
RewriteRule (.\*) http://www.mydomain.com/test/$1 [L,R=301]
</IfModule>


My INDEX.HTML file
<!DOCTYPE html>
<html>
<body>
<p>
Hello
</p>
</body>
</html>


I added this .htaccess file to multiple locations:
/nfs/WWW_pages/myuserid/.htaccess
/nfs/WWW_pages/myuserid/mydomain/.htaccess
/nfs/WWW_pages/myuserid/mydomain/test/.htaccess
by audiomason » Fri Mar 31, 2023 2:18 pm
Were you able to get this to work? I just tried doing the same thing and got the same results. It seems like Sonic's web server is configured to look for a virtual host matching the sub-domain, and when none is found it returns the "New Home Page".
2 posts Page 1 of 1

Who is online

In total there are 19 users online :: 0 registered, 0 hidden and 19 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 19 guests