I have created new website /
and I have one old site /
. We have a customer support ticket portal and that portal URL is /
. Now I have changed the support portal URL into /
Now I want to add redirection for following conditions on .htaccess
.
- Redirect
/
to/
- Redirect
into
- Redirect
into
How can I achieve this anyone knows the solution for this one?
I have created new website https://example1/
and I have one old site https://example/
. We have a customer support ticket portal and that portal URL is https://support.example/
. Now I have changed the support portal URL into https://support.example1/
Now I want to add redirection for following conditions on .htaccess
.
- Redirect
https://support.example/
tohttps://support.example1/
- Redirect
https://support.example/a/ticket/124
intohttps://support.example1/a/ticket/124
- Redirect
https://support.example/ticket/124
intohttps://support.example1/ticket/124
How can I achieve this anyone knows the solution for this one?
Share Improve this question edited Oct 11, 2019 at 9:29 developerme asked Oct 11, 2019 at 8:32 developermedeveloperme 1415 silver badges18 bronze badges 5 |1 Answer
Reset to default 1To redirect just those 3 URLs (with variable ticket number) on the support
subdomain then you can do something like the following before the WordPress front-controller (assuming the support
subdomain resolves to the same place and is probably handled by WP) using mod_rewrite, in the root .htaccess
file:
RewriteCond %{HTTP_HOST} ^support\.example\ [NC]
RewriteRule ^((?:a/)?ticket/\d+)?$ https://support.example1/$0 [R=302,L]
Change to a 301 (permanent) redirect only when you are sure it's working OK.
Note that this doesn't specifically redirect HTTP to HTTPS.
support
subdomain on HTTP only? You don't want to redirect the domain apex (your new site) and you don't wish to redirect to HTTPS? – MrWhite Commented Oct 11, 2019 at 9:22support
subdomain also points to your wp installation (is this also handled by wp)? – MrWhite Commented Oct 11, 2019 at 9:53