Forum Moderators: phranque

Message Too Old, No Replies

Difficulty with internal anchor and request_uri

And that's about it

         

omphalocele

5:06 am on Jun 26, 2005 (gmt 0)

10+ Year Member



Hi everyone. Let's say I have a bit of text on my site on the file that can be directly reached through the URL [mysite.com...] Let's assume further that I want to leave the internal anchor #blah in place, but for murky reasons don't want people from somesite.com to be able to reach this bit of text directly. I don't want to bar them from reaching the page. This is what I have:

RewriteCond %{HTTP_REFERER} ^http://(www\.)?somesite\.com.*$ [NC]
RewriteCond %{REQUEST_URI} ^/yeehaw.htm(.*) [NC]
RewriteRule \.*$ [(www\.)jokesite.htm...] [R,L]

Sure enough, this redirects to jokesite.com but also does so when the internal anchor portion of the URL is omitted. I have tried to make this specific to suit my needs with all sorts of permutations of +, (, ), you name it, but I'm no programmer and am new at this so I am asea. I assume this is weeeeeeeeeeeeeery simple to fix...thanks!

The o.c.

dcrombie

9:19 am on Jun 26, 2005 (gmt 0)



The anchor text (anything following '#') is not seen by Apache so can't be used in any rewrite rules.

omphalocele

2:35 pm on Jun 26, 2005 (gmt 0)

10+ Year Member



Thanks -- so my own incompetence/inexperience is not (solely) to blame. Is there perhaps another way I can accomplish the same goal, perhaps by invoking the text string following the # in the original URL?