What better header() vs htaccess?

Hello everyone,it's best to use was redirected with 301 header function of php or all the same if I have htaccess redirects 5060 =)What will faster work ? Thank you for your attention =)
June 8th 19 at 17:15
3 answers
June 8th 19 at 17:17
Solution
Each of the tools is swave advantages.
HTACCESS
+ "expected" place for such things, and Eonic to climb in their search.
+ There are many ready presets and gernerators for the rules.
Strange behavior redirects ( mod_rewrite, you need to know to understand what happens and why)
- does not work on nginx and iis
- difficulty of creating redirects with get parameters.
- a large number of redirects, reduces the performance of the website ( But in practice not noticeable)

php
+ no problems with the redirects GET parameters
+ there is no sequence of type codes 301 +301 +301+200
+ it is possible to do a redirect type to 301 do if the current 404 status of the url and indeed you can put in
404.php ( in .htaccess is possible too but ...)
+ works on any web server
-an unusual place to find them, no one will
-seo schnick doesn't know php
June 8th 19 at 17:19
Solution
Better all redirects and rules of URLManager to write PHP. Go to another web server, and remember me, the problems will be less. Plus, you can make the ability to add redirects directly from the admin panel.
June 8th 19 at 17:21
Solution
If the rules for forwarding are not too many, use the redirects Apache/Nginx, ie file .htaccess in Your case.

Find more questions by tags Processing URLPHPhtaccess