: .htaccess 301 Redirect for wildcard subdomains I run WordPress in Network mode, which means I can have multiple websites running off one installation of WordPress. Each website runs as a subdomain.
I run WordPress in Network mode, which means I can have multiple websites running off one installation of WordPress. Each website runs as a subdomain. WordPress handles this using .htaccess, and a wildcard subdomain pointing to the location of WordPress, so there are no actual subdomains created in cPanel; just a wildcard subdomain in cPanel, ad WordPress handles the rest.
I want to 301 redirect one.example.com/portfolio to two.example.com/portfolio.
If I only have 1 .htaccess file in the web root of example.com, how do I achieve this?
EDIT: I have used the following but it does not work:
RewriteCond %{HTTP_HOST} ^steve.doig.com.au$ [NC]
RewriteRule ^/products.html tech.doig.com.au/products.html/ [L,R=301]
(this is to redirect steve.doig.com.au/products.html to tech.doig.com.au/products.html)
More posts by @Phylliss660
1 Comments
Sorted by latest first Latest Oldest Best
If I am not mistaken, you should be able to do something like this:
RewriteCond %{HTTP_HOST} ^one.example.com$ [NC]
RewriteRule ^portfolio$ two.example.com/portfolio [L,R=301]
This is from memory, but maybe you get the idea (HTTP_HOST).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.