View Full Version : Upper and lower case URLs
drink75
26-Jun-2006, 02:54 PM
Not realy an Actinic question but does effect an Actinic site I'm working on and I'm sure one of the resident genious's will know.
I have keycodes set up in actinic and have prepared bounce pages such as:
www.jean-patrique.co.uk/ESA062
The bounce page contains a referer script which auto enters the keycode and takes you to a landing page where an offer exists.
Problem is where people mis-type the url by putting the code part in lowercase:
www.jean-patrique.co.uk/esa062
I know this is a server issue. I have tried to get mod_spelling to work in apache but this does not seen to work with our providers (FASTHOSTS).
Anyone got a alternative?
Mike Hughes
26-Jun-2006, 03:09 PM
Assuming you're using a .htaccess file to do the redirect then it might be possible to make it recognise upper and lower case urls as being the same. Not sure though.
The way I would do it is to create a simple keycode page and then use php / asp to check the code and jump to the right page. You can still send out links directly to the page, it's only when a customer has to enter the code that you process the entry to amke sure everything is in upper case. Can be done in javascript too if you want.
Mike
drink75
26-Jun-2006, 03:23 PM
I am actually using a html page with a meta redirect as I have zero knowledge of PHP etc.
Mike Hughes
26-Jun-2006, 03:56 PM
Are you hosting on a unix or windows server?
Mike
drink75
26-Jun-2006, 04:03 PM
It's a Fasthosts dedicated Linux server
Mike Hughes
27-Jun-2006, 08:42 AM
Here's some code that should do this for you:
1. Use this code on a page (or cut and paste the html into your own page). This just allows the visitor to enter the keycode and then calls the php script.
<html>
<head>
</head>
<body>
</form>
<FORM METHOD=POST ACTION="switcher.php">
<table border=0 cellspacing=0 cellpadding=2>
<TR>
<TD colspan=2>Enter Keycode here:<br></TD>
</TR>
<TR>
<TD>KeyCode <INPUT type="text" name="KeyCode" size=30 value=""> <INPUT type=submit value="Enter"></TD>
</TR>
<table>
</form>
<form>
</body>
</html>
2. Change the Keycodes and page destinations on this script to suit and then upload to your website as switcher.php .
# Enter the default/error page here
$DefaultPage="http://www.yourdomain.com/somepage.html";
# This line prevents values being entered in a URL:
if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != "POST")
{
echo "<META http-equiv='refresh' content='0;URL=$DefaultPage'>";
exit;
}
# Import the variable
$KeyCode = stripslashes($HTTP_POST_VARS['KeyCode']);
# trim it
$KeyCode = trim ($KeyCode);
# Make upper case
$KeyCode = strtoupper($KeyCode);
# This decides where to send the page to. Enter as many cases as you want.
switch ($KeyCode)
{
case "ABC1" :
$Goto = "http://www.yourdomain.com/page1.html";
break;
case "ABC2" :
$Goto = "http://www.yourdomain.com/page2.html";
break;
case "ABC3" :
$Goto = "http://www.yourdomain.com/page3.html";
break;
default :
$Goto = $DefaultPage;
break;
}
# jump to the destination page
echo "<META http-equiv='refresh' content='0;URL=$Goto'>";
?>
</body>
</html>
I did test this and it sems to work Ok for me. This assumes of course that you can run php on your server.
Mike
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.