I want to redirect a URL like
https://www.domain.com/#new
to
https://www.domain.com/new.html
How can I use .htaccess
?
I want to redirect a URL like
https://www.domain.com/#new
to
https://www.domain.com/new.html
How can I use .htaccess
?
Unfortunately the hash
part of the URL is not being sent by the browser to the server, so in the server you can't really use this part to do the redirect.
You will have to use javascript
code for that:
hash = window.location.hash
if (hash.length > 0) {
window.location = '/' + hash.substr(1) + '.html'
}