-2

I have a problem, I want to redirect htaccess The content of domainold.com is still used, only this URL has changed

from the Old website, namely http://domainold.com/product/register

to my new site, namely http://domainnew.com/product/register how to do it, I have tried the method

RewriteCond %{HTTP_HOST} ^domain\-old\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\-old\.com$
RewriteRule ^product\/register\/?(.*)$ "https\:\/\/domain\-new\.com\/product\/register\/$1" [R=301,L]

but can't, can you help me to solve this problem?? please help !!

2 Answers 2

0

I have a problem,

That's usually why people post here. No need to assert it.

I want to redirect htaccess

No - you want to implement a redirect and htaccess is one of the places you can do that.

I have tried the method....but can't,

Can't what? Were you able to add this to the config? What happenned?

Assuming that you put the config in a file named .htaccess and your webserver is configured to check the .htaccess files and the webserver is apache...

RewriteCond %{HTTP_HOST} ^domain\-old\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\-old\.com$

All the rewriteCond rules must be satisifed before the rewrite rule is applied - but your rules are mutually exclusive. The hostname cannot have 2 different values.

Try replacing these 2 lines with:

RewriteCond %{HTTP_HOST} domain\-old\.com$
1
  • no. I've found that answer before, not from you but from others. thanks for that Nov 4 at 5:50
-1

I got the answer from next door, thank you for your help this is link Click

Thank's brother @CBroe

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .