0

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 directly (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 ...

2 Answers 2

1

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 !!! :))))

Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

Yes, I know that. But, if you try this url - for example: facebook.com/pages/TEST-Srs/112476695487599#!/pages/TEST-Srs/… You'll see the same redirection, and if you turn off JS on your browser, and paste this url and hit enter - you'll see the same redirection. That's why I tought it's possible with .htaccess. (Cause with php - we don't get the hash of the url.)
@user586517: It’s the browser that does this. It’s triggered by the #! (see Making AJAX Applications Crawlable).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.