I am building a javascript application with ajax loads, and incase any user visits a URL with a hashbang in it, I want to rewrite the URL and remove i开发者_高级运维t. I am not very familiar with mod_rewrite, but I gave this a shot:
RewriteCond %{REQUEST_URI} ^#! [NC]
RewriteRule ^#!/(.*)$ http://mysite.com/$1 [R=301]
I even tried escaping the special characters by using \#\!
in both the places, but somehow I getting some weird erractic redirects.
The fragment of a URI is only for local use and is not part of the request to the server and thus not available on the server side. So you can’t remove it with mod_rewrite or any other server side technique.
精彩评论