apache - Using PHP script to assist .htaccess mod_rewrite -


I am planning to use large amounts of URL rewrites on my website, but I'm not familiar with the mod_rewrite of Apache It may be because it is difficult and poorly documented.

I have heard that there are some options that are allowed to use different scripts for the purpose of re-writing. Can you help me with this?

Do not do that, at least not indiscriminately. You can redirect any request to PHP and parsing it there. This is an attractive option, but for performance it is very awesome because the expensive PHP process has been started for every request of all the resources of images, style sheets and so on.

Only when many URLs are rewritten (after steps or restructuring of a site like dozens, hundreds or thousands), it may mean redirecting to a PHP script that performs a database lookup .

mod_rewrite very closely is documented, it just moves in some, but still you should know the basics of mod_rewrite to request to redirect to that script .

I recommend basic learning.

There is a good resource to get started, there are many good questions that are SO examples of official documents.


Comments