How to use $_get parameter to make seo friendly urls?
@cameron_walter
To use the $_GET parameter to create SEO-friendly URLs, follow these steps:
1 2 3 4 |
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] |
1
|
$url = $_GET['url']; |
By implementing these steps, you can create SEO-friendly URLs that are more readable by both search engines and users. For example, instead of using a URL like example.com/index.php?url=products&category=electronics
, you can have example.com/products/electronics
, which is much more user-friendly and beneficial for SEO purposes.