.htaccess tutorial

htaccess Elite


rewrite subdomain to secure server address

Ask your mod_rewrite and Redirection questions here, and get answers!

rewrite subdomain to secure server address

New postby acmeinc » 07 Mar 2009 03:06

Ok, this should not be as hard as I have been making it. I want to rewrite a subdomain for website to the absolute server address for my hosting provider. This is a temporary fix to get around the need for my own certificate.

EXAMPLE:

Code: Select all
rewrite http://www.domain.com/store  TO  https://server.host.com/username/domain/store
AND
rewrite https://www.domain.com/store  TO  https://server.host.com/username/domain/store
AND
rewrite http://domain.com/store  TO  https://server.host.com/username/domain/store
AND
rewrite https://domain.com/store  TO  https://server.host.com/username/domain/store


This has proven to be difficult cause I only need to rewrite requests which come from domain.com rather than the correct request from server.host.com. Mainly if you can help me with one, I should be able to figure out the rest.
acmeinc
 
Posts: 4
Joined: 07 Mar 2009 02:59

Re: rewrite subdomain to secure server address

New postby acmeinc » 07 Mar 2009 04:28

Could not edit this post for some reason :( Anyways replace all instances of subdomain with subdirectory. Thanks!
acmeinc
 
Posts: 4
Joined: 07 Mar 2009 02:59


Return to Redirect or Rewrite Questions