S
S
shasoft2016-07-13 13:25:42
PHP
shasoft, 2016-07-13 13:25:42

How will routing work faster: php or .htaccess?

Routing needs to be done. There will be a maximum of 10 options. I made a redirect to one script and I already parse $_SERVER['REQUEST_URI'] in it. But maybe htaccess will work faster?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Slava Vitrenko, 2016-07-13
@shasoft

Of course, it is better to write the contents to the virt configuration file. host, then the rules will be in memory.

O
Optimus, 2016-07-13
Pyan @marrk2

htaccess is faster, php is more flexible
In routing to php, htaccess will still be involved too

S
shagguboy, 2016-07-13
@shagguboy

htaccess is faster BUT. only works for Apache, i.e. no PHP-FPM.
more difficult to update. the simplest logic of work - for example, you can’t do it anymore to give access to the route only for a certain group of users

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question