Forum Moderators: phranque

Message Too Old, No Replies

http to https mod rewrite in .htaccess for subdomain

Change subdomain http to https in .htaccess

         

chills

5:02 am on Jun 1, 2007 (gmt 0)

10+ Year Member



I have a mod rewrite problem that I cannot find a solution to. So, if anyone is interested in solving this for a high school teacher, I sure would appreciate it.

I have the following .htaccess file in my root directory for http://www.example.com

RewriteCond %{HTTP_HOST} ^([^.]+)\.k12\.example\.com$ [NC]
RewriteCond %{HTTP_HOST}!^www [NC]
RewriteCond %{REQUEST_URI)!^%1/ [NC]
RewriteRule ^(.*)$ /home/httpd/vhosts/example.com/httpdocs/webumake/teachers/%1/$1

This rewrite creates [username.k12.example.com,...] and replaces the username with the typed in name, so my website of [chills.k12.example.com...] will be exactly the same in the url address. I have a subdomain program installed in the web site builder that does this for any username account created.

The question I have is how do I change the rewrite so that anyone who types in [chills.k12.example.com...] will have it changed to [chills.k12.example.com?...]

Sincerely,
Charles

[edited by: jatar_k at 11:39 am (utc) on June 1, 2007]
[edit reason] please use example.com [/edit]

ahmedtheking

11:06 am on Jun 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have a look at: [webmasterworld.com...]

Or there's: [forums.asmallorange.com...]

PS don't post your URL!

chills

1:22 am on Jun 3, 2007 (gmt 0)

10+ Year Member



Dear ahmedtheking,

Sorry for the mistake and thank you for your help. I will take a look at the suggested urls.

Charles