0

I need to redirect some page in website :

site.com/sub1/sub2/sub3 redirect to site.com/newsub I write this code for this redirect

RedirectMatch 301 /sub1/sub2/sub3/(.*) /newsub//$1

everything is ok but I need this url not redirected

site.com/sub1/sub2/sub3/pages

how can I do this?

Abolfazl Yavari
  • 231
  • 1
  • 2
  • 15

1 Answers1

0

Do you want to have 'site.com/sub1/sub2/sub3/pages' in a variable? if yes, then

RedirectMatch 301 (/sub1/sub2/sub3/)(.*) /newsub//old_url=$1$&$2

gives you '/sub1/sub2/sub3/pages' in old_url and you just add domain name

malugina
  • 196
  • 1
  • 6