What is the purpose of mod_rewrite in PHP and how is it commonly used in web development?
Mod_rewrite in PHP is used to manipulate URLs and redirect requests on a web server. It is commonly used in web development to create user-friendly URLs, improve SEO, and handle URL redirections. This can help improve the overall user experience and make websites more accessible.
RewriteEngine On
RewriteRule ^about$ about.php [L]
RewriteRule ^contact$ contact.php [L]
Related Questions
- What are some common reasons for receiving a "Connection refused" error when using fsockopen() function in PHP to check server status?
- What are some best practices for accurately determining a user's location using PHP?
- What are the key considerations for PHP developers when designing user-friendly interfaces that utilize form elements for data processing and manipulation?