Forum Moderators: phranque
http://www.example.com/%3E
Due to prior interactions, poor documentation online, and inability for others to post something for me to *replicate* (as learning is the detection of patterns) I'm instead asking how to do a wild card match for the string '3E' in the URL?
- John
RewriteCond %{HTTP_USER_AGENT} ^P3P\ Client$
RewriteCond %{THE_REQUEST} ^/([^\%]*)\%3E[^?]*\? [NC]
RewriteRule .* /%1 [L]
However, it might be possible to catch this with a simpler rule:
RewriteCond %{HTTP_USER_AGENT} ^P3P\ Client$
RewriteRule ^([^>]*)> /$1 [L]
Jim
- John
* Edited - live to local, running Apache 2 locally.
[edited by: JAB_Creations at 7:28 pm (utc) on Jan. 18, 2008]
RewriteCond %{HTTP_USER_AGENT} ^P3P\ Client$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\%]*)\%3E[^?]*\?? [NC]
RewriteRule .* /%1 [L]
Jim
[edited by: jdMorgan at 1:05 am (utc) on Jan. 19, 2008]
Which brings me to a good question, is there a way to have Apache reveal more detailed information when I encounter an error 500? Thanks for your help!
- John
I'm not exactly sure what the symbol is
It's the encoded version of the greater than symbol (>) as George implied, which does make it seem like a bad link somewhere, maybe in the inline policy reference?
<meta http-equiv="P3P" content='policyref="http://www.example.com/w3c/p3p.xml"'>
[edited by: Receptional_Andy at 2:06 pm (utc) on Jan. 21, 2008]
header('P3P: policyref="http://www.example.com/w3c/p3p.xml"');
Locally I get the following message (running Apache 2.2.3)...
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Then I removed this line...
RewriteEngine On
and then received this message...
Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration
I've been waiting about twenty minutes for the live server to update the error message log.
- John
The logs for my current live server update in the afternoon. There is no error.log file itself, just a list in the control panel which I presume will be updated when the server recompiles the monthly log.
- John
RewriteCond %{ENV:rwDone} !^True$ [NC]
RewriteCond %{HTTP_USER_AGENT} ^P3P\ Client$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\%]*)\%3E[^?]*\? [NC]
RewriteRule . /%1 [E=rwDone:True,L]
Jim
The second script now works live on Apache 1.3.39. I'm not sure what I did differently however? What is the rewrite rule doing in English? With my very rough understanding of operators my best guess is that ^> is that since %3E is a > character this is cropping off anything after this character and sending the URL before the greater than symbol?
What would be keeping Apache 2 from executing the simpler script? I use a slightly modified version of XAMPP locally.
- John
Yes. But it's not "sending" anything. It is simply changing the URL-path that the server will next convert to a filepath -- by lopping off the ">" on the end.
If this were a search engine, I'd recommend using an external redirect. But if the the validator is producing and requesting bad URLs, there's no guarantee that it would follow the redirect correctly either -- and I assume that your goal is to simply get the validation completed.
Jim