URL case sensitivity

Status
Not open for further replies.

yhwhan

New Member
Messages
2
Reaction score
0
Points
0
I noticed that my URL's are case sensitive: for example, http://yhwhan.x10hosting.com/jsbreakout works fine, but http://yhwhan.x10hosting.com/JSBreakout brings up a 404 page. Is there any way to make the URLs case insensitive?

Judging by the fact that there isn't a single post on this, this is probably a completely newbie question, and I realize that, considering only http://x10hosting.com/account works but http://x10hosting.com/Account doesn't, this might not even be possible, but I couldn't help but notice that https://www.google.com/accounts/MANageACCount works as well as https://www.google.com/accounts/ManageAccount, so I am hoping X10 may be able to do something similar.

I don't see how this pertains to my issue, but my username is yhwhan, my domain is yhwhan.x10hosting.com, and my package is Ad-Free.
 
Last edited:

eminemix

Member
Messages
350
Reaction score
0
Points
16
Write a 404 error page with this code :

PHP:
<html><head><title>Page not found</title>
<meta name="robots" content="noindex,nofollow">

<script language=javascript>
<!--

// The three functions are general read, set and delete cookie-functions -
// copied from this page: http://www.echoecho.com/jscookies02.htm

// The rest of the javascript is specificallye made for 404-files on casesensitive servers
// it converts the url til lowercase to see if the reason for the 404 error is one ore more uppercase letters
// *** NB! - make sure all folder and file names on the website are written in lower case ***
// Copyright: Forbrugerportalen, 2004
// http://www.forbrugerportalen.dk/sider/casesensitive404-english.htm



varURL=top.location.href;


function getCookie(NameOfCookie)
{

if (document.cookie.length > 0)
{
  begin = document.cookie.indexOf(NameOfCookie+"=");

  if (begin != -1)
  {
    begin += NameOfCookie.length+1;
    end = document.cookie.indexOf(";", begin);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(begin, end));
  }
}
else
{
return null;
}
}



function setCookie(NameOfCookie, value, expiredays)
{
  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
  document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}



function delCookie (NameOfCookie)
{
  if (getCookie(NameOfCookie))
  {
    document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}



strLowcase=getCookie('lowcase');

if (strLowcase!=null)
      // If the cookie exists, the adress has been converted to lowercase and still results in a 404-error

{
   document.write("The page <b>" + varURL + "</b> was not found.<br><br>");
  document.write("<a href='/' target='_top'>To homepage...</a><br><br>");
  delCookie('lowcase');
}

else
      // If the cookie doesn't exist, the URL is converted to lowercase
{
  setCookie('lowcase',"on",(10/86400));
      // The cookie is set to expire in 10 seconds
      // - because anothere problem with casesensitive URL's can arise again in the same session
  varURLsmaa=varURL.toLowerCase();
  top.location=varURLsmaa;
}


-->
</script>

</head>
<body>
&nbsp;

</body></html>

If you will use this make sure that all your files are lowercase.
From here.
 
Last edited:

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
URLs are case-sensitive, that's why it's always recommended to make your folders & files in lower-case.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
205
Points
63
You could do this with some fancy mod_rewrite but if you are a beginner I wouldn't suggest it.
 
Status
Not open for further replies.
Top