2
votes

I wanted to redirect old domain to a new domain with a subpage

example: olddomain.com redirect to newdomain.com/subpage

here is what I have in my .htaccess

RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/newdomain\.com\/subpage\/" [R=301,L]

but it's redirecting to the newdomain.com instead of newdomain.com/subpage

1
Do you mean olddomain.com is redirecting to newdomain.com/ instead of newdomain.com/subpage/ ?Amit Verma
yes that's what I meansandyff
Your rule already does that. Clear your browser cache.Amit Verma

1 Answers

0
votes

I don't know why you are using mod_rewrite, because this could be done simpler within the config of your olddomain:

Redirect permanent / http://newdomain.com/subpage/