0

I have recently set up a site "saskatoonwashworld.com" with SSL. I have two issues that I need to resolve...

1) Route all http requests to https (I was able to do this easy enough with code found online)

2) I also have a subdomain "portal.saskatoonwashworld.com" which I want redirected to "https://secure3.washcard.com/AP?CID=65e53149-59e9-4d67-a746-e475aa4bc7be" which is hosted by another site. I want the requests to go here whether or not the user types in http://portal.###, https://portal.###, or just the url without the http(s).

I cannot figure out how to do it as I don't know how to properly code the conditions and rewrites.

I was originally using this code found online for the http to https redirect...but if I'm understanding it correctly, it is using a wildcard to catch "www." and so would ignore/override my "portal." subdomain anyways. But I could be wrong.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://saskatoonwashworld.com/$1 [R=301,L]

1 Answers1

0

Try this rewrites in .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?portal\.saskatoonwashworld\.com [NC]
RewriteRule (.*) https://secure3.washcard.com/AP?CID=65e53149-59e9-4d67-a746-e475aa4bc7be [R=301,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://saskatoonwashworld.com/$1 [L,R=301]
JarekBaran
  • 1,311
  • 2
  • 7
  • 12
  • It is only partially working. If I type "portal.saskatoonwashworld.com" into the URL entry field it just goes to the site home page which is undesireable. But, if I type "https://portal.saskatoonwashworld.com" it redirects the way I would like. – Shane Kartz May 03 '19 at 06:32
  • Sorry but I do not understand. Hmm, i'm click and entry URL manualy and redirect is working. You tried on a different browser, maybe cache or another reason :( – JarekBaran May 03 '19 at 06:43
  • Clicking the link in the comments above does redirect properly, but if I enter it manually without the https:// it does not get resolved to the redirect, it instead goes to the site root. I have tried every browser and multiple devices. Same result every time. I am also wondering if I should be doing any redirects or modifications in cPanel for the site to help accomplish this functionality? – Shane Kartz May 03 '19 at 15:17