-3

I have a server pointing to DocumentRoot /var/www/mysite

I would like to redirect all requests from /var/www/mysite/folder/ to /var/www/mysite/

I tried the following:

 `RedirectMatch 301 /mysite/folder/(.*) http://example.com/folder/$1`

But it doesn't work.

After spending several hours on it, I can't find where is the problem.

Do you have any ideas?

Thanks

2 Answers2

1

You need to remove /mysite from the redirect-match. The redirect-match is relative to the document root.

RedirectMatch 301 /folder/(.*) http://example.com/folder/$1
thelogix
  • 389
  • 1
  • 7
-1

Try this:

RedirectPermanent /folder/ http://example.com/
Falcon Momot
  • 24,975
  • 13
  • 61
  • 92