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 example.com/sitemap using htaccess.
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
- Fix PHP Error: Allowed Memory Size of X Bytes Exhausted
- How to Redirect a Page or Website Using htaccess
Was this article helpful?
Discussion
Loading the discussion…
Sign in to join the discussion.