Home 301 redirect subcategory to specific page and redirect rest of site as well
Reply: 1

301 redirect subcategory to specific page and redirect rest of site as well

Brinley
1#
Brinley Published in 2018-01-12 11:09:36Z

I am trying to redirect a subcategory on a website to a particular page on a new domain and redirect everything else from the old domain to the new domain.

The site redirect I have set up like this:

RewriteEngine on 
RewriteRule (.*) http://www.new-site.co.uk/$1 [R=301,L]

But I also want to redirect a subcategory on the old site to a particular page on the new site.

For example I would like https://www.old-site,co.uk/category/subcategory (with and without trailing slash at the end) to redirect to https://www.new-site.co.uk/page.htm

Any help would be appreciated.Thanks!!

starkeen
2#
starkeen Reply to 2018-01-12 14:36:54Z

You can use this

RewriteEngine on

#redirect /category to a specific page on external domain
RewriteRule ^category/?$ http://www.new-domain.com/page.htm [L,R]
#everything else to newdomain
RewriteRule (.*) http://www.new-site.co.uk/$1 [R=301,L]

Clear your browser cache before testing this.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.337216 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO