#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    PNW
    Posts
    3
    Rep Power
    0

    [Resolved] Help w/wild car cert and subdomain on Apache 2.2.6


    Hi there,

    I've been tasked with replacing a standard SSL cert for a website with a wildcard cert. I've got the new cert installed and now need to adjust the httpd.conf file to address the new subdomain (I'll call 'newww').

    Current re-write rule takes traffic from port 80, rewrites the url and passes it off to port 443 which in turn proxys to a glassfish server on the back-end.

    Current catch-all rewrite rule:

    RewriteRule ^(.*)$ https:/ /www . site. com / wingnut/jello$1 [L,R]

    The desire is to adjust the httpd.conf so that the rewrite will retain either 'www' or 'newww'.

    I'm guessing by what reading that I've done that I'd need to insert some sort of RewriteCond however I'm unsure of how to properly format it.

    Thank you in advance.

    ~Tant
    Last edited by Tant; February 25th, 2013 at 03:22 PM. Reason: Marking as resolved.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,742
    Rep Power
    9397
    Not entirely sure of your requirements and setup but is it just a matter of
    Code:
    RewriteRule ^(.*)$ https://newww.site.com/wingnut/jello$1 [L,R]
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    PNW
    Posts
    3
    Rep Power
    0
    Thank you requinix.

    The only requirement would be that Apache should take http:// www. site. com and rewrite it to https://www. site. com/wingnut/jello$

    as well as take http:// newwww .site. com and rewrite it to https:/// newwww. site. com/wingnut/jello$

    So that regardless of the subdomain (www or newww) entered by the web-user the URL is re-written to include the subdomain as well as append /wingnut/jello$ before passing it off.

    In short:

    Current: http:// www. site. com/ ---> http:// www. site. com/wingnut/jello$

    Desired:

    Retain current configuration as well as

    Add: http:// newwww. site. com/ ---> https:// newwww. site. com/wingnut/jello$

    I've got the www site set up in a virtual domains that rewrites the entire URL to HTTPS with the /wingnut/jello$ suffix which in turn is interpreted by ssl.conf before it proxypass/reverses information to a back-end Glassfish server.

    The existing RewriteRule did the job until recently when it became a requirement to include the new subdomain name so the web-site owner can pass off traffic to this site from another site while maintaining the current site's www URL name.

    ~Tant
  6. #4
  7. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,742
    Rep Power
    9397
    So both www.site.com and newwwwwww.site.com get the HTTPS redirection?

    Could make it easy and just say every domain gets rewritten.
    Code:
    RewriteRule ^ https://%{HTTP_HOST}/wingnut/jello%{REQUEST_URI} [L,R]
    (the only functional difference being the HTTP_HOST)
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    PNW
    Posts
    3
    Rep Power
    0
    Thanks again, Requinix, that did the trick. I'm a bit humbled as I knew that the formatting had to be simplistic but for the life of me I was having no luck with the different combinations I tried.

    Cheers!

    ~Tant

IMN logo majestic logo threadwatch logo seochat tools logo