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]

Was this answer helpful?

 Print this Article

Also Read

How to ban any IP Address via .htaccess?

If someone is trying to hack your website or you want to block their IP Address, you can add this...

How to protect your .htaccess file?

For security purpose we recommended you to prevent access to your .htaccess file from...

How to update DNS Nameserver on 123-reg?

After purchasing our hosting account, you will receive a Welcome email from us which contains our...

php error: Allowed memory size of x bytes exhausted

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

How to update DNS Nameserver on Godaddy?

After purchasing our hosting account, you will receive a Welcome email from us which contains our...