15
5
I have two subdomains, a.website.com and b.website.com, pointing to the same IP address. I want to redirect b.website.com to a.website.com:8080. I have this in my .htaccess file...
RewriteEngine on
RewriteCond {HTTP_HOST} b\.website\.com
RewriteRule ^(.*)$ http://b.website.com:8080$1 [L]
...but it does not work.
Is there a way to make it work?
Try adding the following to
– jww – 2016-11-06T08:27:14.887.htaccess
in the parent directory above the directory of interest:RedirectMatch ^/foo/$ /foo/bar/
orRedirectMatch ^/foo/$ /bar/baz/
. Also see How to get apache2 to redirect to a subdirectory.