[thelist] New lister question about .htaccess and redirects
John C Bullas
jcbullas at nildram.co.uk
Tue Sep 23 01:33:38 CDT 2003
Hi!
I am a road safety researcher who is fighting the dark forces of Microsoft
Internet Explorer with the shield and sword of Apache!
I have a question about using regexp in .htaccess
The site is here http://www.ime.org.uk - an online resource for Mini
owners!!!
I have files of the form <single a-z character>.htm in one directory
(http://www.ime.org.uk/ime/) and want to put a Redirect Permanent regexp
in my root .htaccess to route all calls for <single a-z character>.html
ANYWHERE AND <single a-z character>.htm anywhere but
http://www.ime.org.uk/ime/ to the <single a-z character>.htm in directory
(http://www.ime.org.uk/ime/)
I have either generated the Apache white screen of death (500 error) or
end up redirecting say http://www.ime.org.uk/ime/e/electrol.html to
ime/l.htm!!!!!
Could someone assist???????
All this started after I started running a PHP 404 logger!! then I
discovered via the numrous emails it sent that the redirected calls from
the sites 2 other existences were hitting the wrong directory or used old
filenames
Regards
John C Bullaa
http://www.fatblokeracing.org
Webmaster htttp://www.IMM2004.org / http://www.ime.org.uk
================ php script for info ==================
<?php
$ip = getenv ("REMOTE_ADDR");
$requri = getenv ("REQUEST_URI");
$servname = getenv ("SERVER_NAME");
$combine = $ip . " tried to load " . $servname . $requri ;
$httpref = getenv ("HTTP_REFERER");
$httpagent = getenv ("HTTP_USER_AGENT");
$today = date("D M j Y g:i:s a T");
$message = "The IMM2004 Webmaster has been informed that:<br>On
$today, \n
$combine <br> \n
User Agent = $httpagent <br>\n
$note\n
Referring URL (if any) : $httpref";
$note = "Referring URL:" ;
$message2 = "$today \n
$combine \n
User Agent = $httpagent \n
$note \n
$httpref ";
$to = "webmaster at imm2004.org";
$subject = "404 recorded on the IMM2004 Website";
$from = "From: r139 at easily.co.uk\r\n";
mail($to, $subject, $message2, $from);
echo $message;
?>
================================================================
More information about the thelist
mailing list