LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > Named anchor passed in URL resulting in 404 error

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2011, 09:34 AM
dcanali dcanali is offline
New Member
 
Join Date: Oct 2011
Posts: 2
Default Named anchor passed in URL resulting in 404 error

Hello,

first of all, I apologize if my post is not in the appropriate section of the forum. In fact, I think this is not a real bug even though in my opinion it affects the reliability of the webserver.

I realized that in Litespeed, issuing a http request with an URL in which the anchor part has not been removed, results in a 404 error.
The same request, issued, for example, to an Apache2 webserver, correctly returns the page corresponding to the resource.

e.g., issuing a GET to: http://example.com/existing_resource.php#anchor
results in a 404 even if the page existing_resource.php exists.

I know that, by specification, it's the web client that should take care of "cleaning up" the URL and removing parts, such as anchors, that are used only for layout purposes, but some of them (e.g., curl) don't do any URL processing.
Even if the client does not sufficiently clean up the URL, I think it would be a safe idea to strip out eventual anchor parts that are left behind.

I found out the problem using curl on a Wordpress forum hosted on a Litespeed webserver. Wordpress often uses 302 redirects to send a user to a specific page anchor after a post, but specifying the redirect as "Location: page#comment" was making every request with curl fail.

Thank you,

Davide Canali
Reply With Quote
  #2  
Old 10-18-2011, 10:07 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
as a workaround, you can use rewriterule to strip tailing #xxx

for example in document .htaccess:
RewriteRule (.*)#(.*)$ $1
Reply With Quote
  #3  
Old 10-19-2011, 04:49 AM
dcanali dcanali is offline
New Member
 
Join Date: Oct 2011
Posts: 2
Yes, thank you, this should work (even though it would be better for the webserver to handle it).
Reply With Quote
Reply

Tags
anchors, url

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:38 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.