What is the purpose of mod_rewrite in PHP and how can it be used to rewrite URLs?
The purpose of mod_rewrite in PHP is to rewrite URLs in a more user-friendly format or to redirect URLs to a different location. This can help improve SEO, make URLs more readable, and create cleaner URLs for users to interact with.
RewriteEngine On
RewriteRule ^old-url$ new-url [L]
Related Questions
- What is the best practice for generating a list of articles in a PHP array and displaying them with corresponding buttons for ordering?
- What are the best practices for passing language parameters in PHP when switching between different language versions of a website?
- In what situations would using IFNULL in SQL be beneficial when sorting data in PHP?