Welcome to WebmasterWorld Guest from 34.236.171.181

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Confuzzled on rewriting/redirecting #references

trying to redirect file.htm#A to new-file.htm#A

     
3:31 pm on Dec 11, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 2, 2002
posts:1167
votes: 0


I'm stumped.

I'm trying to redirect two links but neither redirect nor rewrite are working, and I don't know if I'm leaving something out or what.

The 301 redirects I tried dinna work:
Redirect permanent /name.htm#referenceA h*tp://www.domain.org/new-name.htm#referenceA

Redirect permanent /name.htm#referenceB h*tp://www.domain.org/new-name.htm

So, I tried to do theswitch over via rewrite, but none of these work either:
1st attempt

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/name.htm#referenceA [NC]
RewriteRule ^(.*)$ h*ttp://www.domain.org/new-name.htm#referenceA [F]
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/name.htm#referenceB [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm [F]

2nd Condition attempts were:

RewriteCond %{REQUEST_URI} ^/name\.htm\#referenceA [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm#referenceA [F]

RewriteCond %{REQUEST_URI} ^/name\.htm\#referenceB [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm [F]

3rd effort:

RewriteCond %{REQUEST_URI} ^name.htm#referenceA [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm#referenceA [F]

RewriteCond %{REQUEST_URI} ^name.htm#referenceB [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm [F]

4th effort:

RewriteCond %{REQUEST_URI} ^w*w.domain.org/name.htm#referenceA [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm#referenceA [F]

RewriteCond %{REQUEST_URI} ^w*w.domain.org/name.htm#reference [NC]
RewriteRule ^(.*)$ h*tp://www.domain.org/new-name.htm [F]

I'm obviously barking up the wrong tree, so if anyone who can help me get back on scent, it would be appreciated.

4:59 pm on Dec 11, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


You won't like the scent, though...

You can't do what you're trying to do, because according to previous discussion here, the #reference anchors are used internally by browsers only. They are not sent to servers when you click on a link, and so cannot be used for external redirection. :(

Jim