How to Create a User-Friendly URL Using .htaccess?

If your website is using long URL like example.com/files/folder/sitemap.html, you can change it into "example.com/sitemap" in .htaccess

Modify this line according to your needs and then add this code to your .htaccess file.


RewriteEngine on
RewriteRule ^sitemap/$   /files/folder/sitemap.html [L]
  • .htaccess, rewrite
  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Související články

What are Error Pages?

Error pages are the pages displayed when a user tries to access a location on your site and...

How to Redirect a Page Elsewhere Using .htaccess?

If a page on your website no longer exist and you want to redirect it to your new page or website...

PHP Error: Allowed Memory Size of x Bytes Exhausted

If you are getting an error like "Allowed memory size of... in file...