I was wondering if somebody could help me with how exactly to write some 301 redirects in my ht access file as I’m not entirely sure and don’t want to break my site.
I need to fix a lot of broken links moving to a new system, so I need to make sure any links previously on the site
that were in news/ and ended with .html
are corrected to domain/the-file-name/
(the file name should mostly be the same as before so should redirect ok)
similarly i need to make sure that any previous files that were .html simply go to filename/
any help?
Where I’m at: (is this right?)
RedirectMatch 301 /news/(.*) http://www.domain.com/$1
1 Answer