Answer the question
In order to leave comments, you need to log in
Is it possible to set up a redirect from a page with the "#!" symbol?
Good afternoon. We are moving from wix and have this problem. It is necessary to redirect visitors from links like "www.mysite.ru/#!bog-morok-seven/etc27" to links like "mysite.ru/bog-morok-seven". Is it possible to implement this somehow, what methods are worth reading about?
Answer the question
In order to leave comments, you need to log in
The issue is resolved as follows:
function themee_hash_redirects() {
?>
<script type="text/javascript">
function themee_hashtag_redirect( hashtag, url) {
var locationHash = document.location.hash;
if ( locationHash.match(/#!/img) ) {
if ( hashtag == locationHash ) {
document.location.href = url;
}
}
}
// Examples how to use themee_hashtag_redirect
themee_hashtag_redirect('#!interview-bright-tone/o23zv', '/interview-bright-tone/');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question