Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-13-2006, 06:19 PM   #1
LQ Newbie
Registered: Jan 2006
Posts: 11

Rep: Reputation: 0
Help w/ Apache htaccess (RewriteRule)

I am trying to match...

With this code...
RewriteRule ^(.*)/p-(.*)/\#bookmark(.*)\.html$ go.php?$4 [L]
But it doesn't match the "#" portion -- any idea how?
Old 03-16-2006, 07:06 AM   #2
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
First of all, even if your don't take into account the bad news below, your regexp would not match what you are trying to match.
would match
But now the real bad news: what you want to do is not possible because the '# portion' is not part of the request to the server. This '# portion' is a named anchor and will cause the browser to scroll to that anchor if it can find it in the document it requested.

If I take your example url:
the actual request sent to the server would be
GET /somethinghere/p-herealso/ HTTP/1.1
It is therefore not possible to take any rewrite action on the named anchor since the server does not know about it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache ReWriteRule, ProxyPassReverse, and Allow From directives yakkerty Linux - Networking 3 06-24-2004 02:21 PM
Apache RewriteRule is driving me nuts ijsman77 Linux - Software 3 04-07-2004 03:25 AM
apache .htaccess emetib Linux - Software 4 09-22-2003 07:50 AM
is htaccess on apache 2.0 not the same as in 1.3 abd_bela Linux - General 3 07-23-2003 06:17 AM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 02:50 AM

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration