Forum Moderators: phranque

Message Too Old, No Replies

https Subdomain Redirect to Root https

         

imbckagn

10:41 am on Mar 6, 2011 (gmt 0)

10+ Year Member



[sub.website.com...]

to

[website.com...]

I am trying to redirect the subdomain (single page) [sub.website.com...] to [website.com...]

My subdomain is in a folder with my host like /public_html/sub/ and my root is /public_html/

Thanks for any help you can offer.

g1smd

11:19 am on Mar 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What code have you tried?

There are more than 500 prior threads with the same question.

imbckagn

5:31 pm on Mar 6, 2011 (gmt 0)

10+ Year Member



I have tried a lot but I will go back and test to record it. I'm assuming in need to edit the htaccess in my /sub/ folder is that correct?

imbckagn

11:27 pm on Mar 6, 2011 (gmt 0)

10+ Year Member



I am able to redirect
http://sub.website.com
to
https://www.website.com/folder/folder/
with the rule below.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ [website.com...] $1 [R,L]

I still need to get
https://sub.website.com
to to
https://www.website.com/folder/folder/
.

I am editing the .htaccess file in the subdomain folder. The subdomain is static HTML and the root is Wordpress.

EDIT

I can now get:

sub.website.com

http://sub.website.com

to
https://www.website.com/folder/folder/


using the rule below but still can't get the https URL of the subdomain to redirect.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.website.com$ [NC]
RewriteRule ^(.*)$ [website.com...] [R,L]

g1smd

1:24 am on Mar 7, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do https requests resolve to a different folder on the server?

The code will need to go in that one.