4
votes

After searching for many post here, I found no luck they are slightly different but I can't handle for now. Please pardon me about this. This are post here I've tried:

Here is what I want to acquired:

  • all url in www.olddomain.com permanint redirect to www.exampledomain.com/page,
  • and in www.olddomain.com have a page that should be redirect to www.exampledomain.com/pagesample

Please note: the old olddomain.com have no files except the index and this htaccess, and the www.exampledomain.com is a wordpress site.

Thanks in advance

1

1 Answers

2
votes

I'm a little confused about this sentence:

www.olddomain.com is have a page will be redirect

I'm assuming you mean www.olddomain.com/page redirect to www.exampledomain.com/pagesample

RewriteEngine On

RewriteCond %{HTTP_HOST} .*olddomain\.com$
RewriteCond %{REQUEST_URI} /page/
RewriteRule ^ http://www.exampledomain.com/pagesample [L,R=301]

RewriteCond %{HTTP_HOST} .*olddomain\.com$
RewriteRule ^(.*) http://www.exampledomain.com/page/$1 [L,R=301]