Answer the question
In order to leave comments, you need to log in
How to setup .htaccess for successful _escaped_fragment_ redirect?
One of the best examples of this new technique is a rather large website - the new version of Twitter. If you are a registered user of the Twitter microblogging service and you have Javascript, you can view the profile by clicking on the following link: https://twitter.com /#!/Hibster_John
However, Twitter wants to maintain compatibility while still having attractive indexed URLs, which is why they use 301 redirects: twitter.com/Hibster_John
Link source
Answer the question
In order to leave comments, you need to log in
If you take this code:
As the URL fragment is not transmitted to the server, you can only use a client side solution. Here’s one using JavaScript:
if (location.href.indexOf("#") > -1) {
location.assign(location.href.replace(/\/?#/, "/"));
}
This simply checks if there is a # in the URL and replaces the first occurrence with /. So /site/#blog would get /site/blog.
The question is solved not by Apaches, but by js.
It's strange that you didn't google stackoverflow right away .
To summarize: the url part with the hashtag does not go to the server.
For example, when requested http://mysite.ru/#!/page_Home
, the piece #!/page_Home
will be thrown back by the browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question