My_account.html to Subdomain

theprogeekftw4717

New Member
Feb 3, 2015
88
0
0
Hey,

I'd like to know how to make it so that if someone visits https://*******.net/account_home.html, they will be redirected to https://account.*******.net without the my_account.html at the end?

Edit:
I use Apache as my webserver just in case if it depends on editing the htaccess.

Regards,
Geek
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
Have a look at the answer on this, it'll probably help you

http://webmasters.stackexchange.com/questions/23448/htaccess-directory-to-subdomain

Or something like this:

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^account\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/account_home.html/$1 [QSA,L]
In order to create virtual subdomains, you must have an existing wildcard DNS record.

Search for "virtual subdomains" or "dynamic subdomains"
 

theprogeekftw4717

New Member
Feb 3, 2015
88
0
0
I just moved to Nginx and I need to know how to do this without the /account_home.html in the link.
I want the link to be "https://account.*****.net"
Also, my whole site is using HTTPS and I'm not able to find one that works for me.

Thanks.
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
I never said wildcard SSL

I said wildcard DNS

Then try:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^account\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/account_home.html/$1 [QSA,L]
 

theprogeekftw4717

New Member
Feb 3, 2015
88
0
0
ysmods said:
I never said wildcard SSL

I said wildcard DNS

Then try:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^account\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/account_home.html/$1 [QSA,L]
Well, I use Nginx so I converted this code and used it on my config but whenever someone tries to access my site, they are automatically redirected to the *****.net/account_home.html.
Also another question, does it work if I use a CNAME or A record called "account" and point it to my server? Because while using a * DNS, I don't want the server IP to be Leaked by some cloudflare revolvers (If you can understand what I mean by that)
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
To be honest, I have no idea, the stuff I posted above is what I found on google to try to help.

Might be worth asking on stackoverflow.com or similar