开发者

.htaccess redirect to the hash (url fragment) if specified

开发者 https://www.devze.com 2023-02-06 12:35 出处:网络
I have this .htaccess file in my project: RewriteEngine on RewriteCond $1 !^( {files and folders that should be accessed directly} )

I have this .htaccess file in my project:

RewriteEngine on RewriteCond $1 !^( {files and folders that should be accessed directly} ) RewriteRule ^(.*)$ /{full url to web root}/index.php/$1 [L]

And now I want to add the functionality to redirect direct开发者_运维问答ly (not just overwrite the url) to the hash of the url - if such hash exists. For example:

site.com/contacts#/company ==> site.com/company

But can't do it yet :( ...

Thanks in advance ...


Yes! ... I found the answer ... when I disabled the flash player and the javascript - then it doesn’t work :)

so - it has the js code to make it redirect to the hash only, and after the code - there is a flash, that do the redirection if the JS doesn’t do it ;)

Pretty clever :) ... tomorrow I’ll ask one of our action script programmers to make a flash, 1x1 px, that do this smile ...

...

YESS !!! :))))


The fragment is not transmitted to the server as it’s for client use only (due to privacy reasons). So you will need to do the redirection using some client side scripting.

0

精彩评论

暂无评论...
验证码 换一张
取 消