Forum Moderators: phranque

Message Too Old, No Replies

# sign in htaccess turns into %23 in url

         

buzi

12:06 pm on Jun 4, 2011 (gmt 0)

10+ Year Member




Hi, i have this rule in my .htaccess file

RewriteCond %{QUERY_STRING} ^CategoryID=16&ArticleID=14&Page=13$
RewriteRule ^/?$ [mysite.com...] [L,R=301]

the # sign is an anchor link on the page.

but the resulting url is [mysite.com...]

and it doesn't go to the anchor link on the page.

any idea how to keep the # showing in the url ?

Thanks

lucy24

3:49 pm on Jun 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For starters, use "example.com" so the url doesn't get obfuscated.

You are sending your users to a nonexistent location. There is no page called "rates#W"; what you're aiming for is "rates.html#W". Or htm, or php, or whatever it may be. (I just checked this to make sure I'm not talking through my hat. Some hosts may be savvy enough to parse # without preceding extension; mine doesn't.)

buzi

8:52 am on Jun 5, 2011 (gmt 0)

10+ Year Member



Hi,
i'm using friendly url's so i don't need to use .php don't i ?
it works fine on my site (joomla 1.6 hosted on Godaddy)
i gave a bogus link of course, do you need the real one to view it in action ?

wilderness

12:19 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As Lucy explained previously, if your using "friendly URL's" , you cannot use page marks (direct links to portions of a page).

Page marks require use of a file extension name to utilize the trailing #

buzi

12:35 pm on Jun 5, 2011 (gmt 0)

10+ Year Member



Got it. thank you both