How to Create a User-friendly URL Using htaccess
How to Create a User-friendly URL Using htaccess
If your website is using a long URL, such as example.com/files/folder/sitemap.html, you can change it to a shorter, more user-friendly format like example.com/sitemap using the htaccess file.
Steps to Modify Your htaccess File
To create a user-friendly URL, follow these steps:
- Open your htaccess file.
- Add the following code:
RewriteEngine on
RewriteRule ^sitemap/$ /files/folder/sitemap.html [L]
Modify the line according to your needs, and then save the changes to your htaccess file.
Related articles
Was this article helpful?
Discussion
Loading the discussion…
Sign in to join the discussion.