Forum Moderators: phranque
RewriteEngine on
RewriteRule!^/(index\.html)?$ http://example.com/ [R=301,L]
However, some requests are redirected and rests are still able to generate 404 errors.
Here are the access log entries:
[02:08:03] "GET //phpads/adxmlrpc.php HTTP/1.1" [b]301[/b] 235
[02:08:03] "GET //Ads/adxmlrpc.php HTTP/1.1" 404 223
[02:08:03] "GET //ads/adxmlrpc.php HTTP/1.1" 404 223
[02:08:03] "GET //adxmlrpc.php HTTP/1.1" 404 219
[02:08:03] "GET //Ads/adxmlrpc.php HTTP/1.1" [b]301[/b] 235
[02:08:03] "GET //ads/adxmlrpc.php HTTP/1.1" 404 223
[02:08:03] "GET //adserver/adxmlrpc.php HTTP/1.1" 404 228
[02:08:04] "GET //ads/adxmlrpc.php HTTP/1.1" [b]301[/b] 235
[02:08:04] "GET //phpAdsNew/adxmlrpc.php HTTP/1.1" 404 229
[02:08:04] "GET //phpadsnew/adxmlrpc.php HTTP/1.1" 404 229
[02:08:05] "GET //phpads/adxmlrpc.php HTTP/1.1" 404 226
[02:08:05] "GET //Ads/adxmlrpc.php HTTP/1.1" 404 223
[02:08:06] "GET //ads/adxmlrpc.php HTTP/1.1" 404 223
Any idea why mod_rewrite is not able to redirect all the non-homepage requests?
Milan
I'd suggest adding a rule ahead of your other rules:
RewriteRule adxmlrpc\.php$ - [F]
[added] (The requests are malformed because they contain two leading slashes.) [/added]
Jim
[edited by: jdMorgan at 2:58 pm (utc) on Mar. 25, 2007]
My concern is why Apache is not able to redirect all such requests.
Milan
RewriteEngine on
RewriteRule!^/(index\.html)?$ - [F]
As such even the above redirect was working when I manually put such malformed url in browser but it misses out some when scanners are doing it concurrently.
Let us see whether Apache can handle the new rewrite. I will update you shortly.
Milan
Basically, it should be impossible to serve any request without running the code, and as long as the code is in the right place in the filesystem, it will be executed for all requests.
Jim