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=shell+access#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