开发者

htaccess redirect conditions

I figured out how to redirect someone, if they happen across one particular filename:

Redirect /index.php http://www.website.com/#myaccount

As you can see, I'm pretty much redirecting that visitor to the same page, which doesn't work. It's an endless look, regardless of the slight/minuscule change.

I want to force someone to see a part of the page, by adding the hash. (it's a little weird, I know)

I'm guessing this 开发者_C百科may be a time to use regex in the htaccess file.

But I thought I'd ask if there's a simpler way to do this from the htaccess file.


The fragment of an URI (the part after the first #) is not sent to the server. That means you cannot use server side techniques to test if the fragment has a certain value of does exist at all; only client side techniques like JavaScript can do that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜