mod_rewite help with ssl

Using a single web hosting account to host multiple sites

mod_rewite help with ssl

Postby koobos » Wed Feb 04, 2009 10:19 am

Hi there,

I am hoping that one of you brilliant folks can help me as I am running into a brick wall. Here is what I am trying to do.

Lets use a domain name of koobos.com for an example.

I have a domain name koobos.com where I just bought a wildcard SSL cert so that subdomains will be secured.

My host, uses cpanel and I guess that this can not be achieved with sub-domains as I had hoped, however it will work with mod_rewrite.

What I would like to do is when someone types in: http://sub.koobos.com it will redirect (hidden) them to https://www.koobos.com/sub.php.

The trick for me has been to make it so there is a pattern I can follow and not have to add a new redirect for each new subdoamin. Also, making sure that the connection turns into SSL.

I have tried about 20 different variations of samples I have found without avail. If someone could help me out, that would be wonderful.

Thank you.
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Postby richardk » Wed Feb 04, 2009 11:35 am

What I would like to do is when someone types in: http://sub.koobos.com it will redirect (hidden) them to https://www.koobos.com/sub.php.

It will need to be http://sub.example.com redirected to (visible) https://sub.example.com the rewritten to (hidden) http://example.com/sub.php or the users request would not be over SSL.

When you go to https://sub.example.com what happens? What is it's document root?
What is https://www.example.com/'s document root?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby koobos » Wed Feb 04, 2009 12:16 pm

Hi Robert,

Thank you for your reply. Please forgive me ignorance, but I do not completely understand your question.

What I am trying to accomplish is this. I am providing secure forms for some of my clients at this domain. I would like the their form address to be secure and a sub-domain format for branding purposes.

So for example, client Pepsi Co would have a forms address of http://pepsi.koobos.com/pepsi.php. I would like that to route to a location in / for secure serving. So they would see:

https://pepsi.koobos.com, but it would actually be https://koobos.com/pepsi.php

Again thanks for your time!
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Postby richardk » Wed Feb 04, 2009 12:30 pm

Please forgive me ignorance, but I do not completely understand your question.

What don't you understand? A document root is the directory you put you web-accessible files in. For example, for https://example.com/pepsi.php the pepsi.php file might be at /home/example.com/https/pepsi.php so /home/example.com/https is the document root.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby koobos » Wed Feb 04, 2009 12:40 pm

ok, got it.

/home/example.com/public_html/
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Postby koobos » Wed Feb 04, 2009 3:05 pm

All https traffic will be served out of: example.com/public_html/
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Postby richardk » Thu Feb 05, 2009 2:10 am

All https traffic will be served out of: example.com/public_html/

Is that what currently happens or what you want to happen? I need to know what currently happens when you go to a sub domain (with HTTPS).

Do you have access to the server configuration?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby koobos » Thu Feb 05, 2009 7:22 am

Yes, that is what I want to happen. The server will read the subdomain as secure even though the files are actually being served from the /html directory. domain is live-forms.com. No, no root access to this server.
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Postby richardk » Thu Feb 05, 2009 11:16 am

Ok, one last time
I need to know what currently happens when you go to a sub domain (with HTTPS).
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby koobos » Thu Feb 05, 2009 12:22 pm

it redirects to /html

try it:
https://sub.live-forms.com/

The page you are seeing is the index.php in /html
koobos
 
Posts: 7
Joined: Wed Feb 04, 2009 9:57 am

Next

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 2 guests

cron