Write URL redirects on .htaccess when merging objects
I'm planning on adding the possibility of merging two objects. I want to let Google/links know that I've moved the content to another URL. The way to go is to add the fol开发者_运维知识库lowing to the .htaccess
redirectMatch 301 /oldurl /newurl
However, most best practice recommendations say that I shouldn't write on .htaccess, because it has security risks. Is there any other option to do it automatically? If this is the only option, what mode would you use and which other security advise would you give?
I'm using PHP with Symfony, although this is a broad question.
thanks!
In your error404 action you could recognize old URL and redirect them to the new one. Return 404 for all the other URLs.
精彩评论