LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

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


I am trying to match...
/somethinghere/p-herealso/#bookmark112

With this code...
Code:
RewriteRule ^(.*)/p-(.*)/\#bookmark(.*)\.html$ go.php?$4 [L]
But it doesn't match the "#" portion -- any idea how?
 
Old 03-16-2006, 06:06 AM   #2
zeitounator
Member
 
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.
Code:
^(.*)/p-\#bookmark(.*)\.html$
would match
Code:
/blabla/p-blibli/#bookmark567.html
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:
Code:
/somethinghere/p-herealso/#bookmark112
the actual request sent to the server would be
Code:
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.
 
  


Reply



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 01:21 PM
Apache RewriteRule is driving me nuts ijsman77 Linux - Software 3 04-07-2004 02:25 AM
apache .htaccess emetib Linux - Software 4 09-22-2003 06:50 AM
is htaccess on apache 2.0 not the same as in 1.3 abd_bela Linux - General 3 07-23-2003 05:17 AM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 01:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:30 PM.

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