I have a conditions:
a) Redirect from help.example.com to example.com/support
b) Redirect from other page, like help.example.com/catalog to example.com/catalog
This all I do in .htaccess file.
My code redirect me only on example.com/support
RewriteCond %{HTTP_HOST}${REQUEST_URI} ^help.example.com/(.+)
RewriteRule ^(.+)$ example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST}${REQUEST_URI} ^help.example.com
RewriteRule ^(.*)$ example.com/support/ [R=301,L]
How can I resolve this problem?
2
Answers
With your shown samples/attempts, please try following htacces rules in your htaccess file. Please place these rules at top of your file, also make sure to clear your browser cache before testing your URLs.
This will catch
help.example.com
ORwww.help.example.com
both kind of urls.Please try this rules for yours a – b conditions:
a) Redirect from help.example.com to example.com/support
b) Redirect from other page, like help.example.com/catalog to example.com/catalog