0

I have a website hosted under a subdomain for testing purposes and have tried to validate the html and css using w3 validator and jigsaw. Depending on the URL I use - http://alt.example.com (9 frameset type errors 4.01 Strict, CSS3 pass) OR http://www.example.com/alt (passes HTML5 / fails CSS3 183 errors, mostly vendor extensions). Why do the links validate differently and which one should I be concerned with? Any ideas on how to go about fixing them would be great.

Mystique Theme, Mystique-Child Theme (with its own style.css using @import url for core.css), WordPress 3.4

2 Answers 2

0

The reason is that the source for the alt one is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
  <title>alt.example.com</title>

</head>
<frameset rows="100%,*" border="0">
  <frame src="http://www.example.com/alt" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>

<!-- pageok -->
<!-- 02 -->
<!-- -->
</html>

In other words, rather than a real 301 redirect, or just being mapped to the same folder, it loads the other URL in a terrible version of an iframe. Check your hosting settings, and change it to a 301 redirect.

1
  • 1
    Rich Thank you for you reply. I guess I was confused on which one to be concerned with, the alt.x.com or the www.x.com/alt I have set a permanent 301 redirect and now it just sends everything to the /alt. I guess to answer my own question, it was the www.x.com/alt that I needed to be concerned with since that is where it is being redirected. Thanks for your help.
    – Calvin Nix
    Aug 10, 2012 at 1:02
0

The better option is to map it to the same folder. This would allow you to use some features available ONLY to sites hosted in the root of a domain, such as site-root relative links.

Although you could achieve this mapping using .htaccess, all major web hosting control panels have options for mapping subdomains to folders. Once you do that, you can change the direction of redirection (lol) -- its in your control. Using a subdomain is better style too.

So you can concern yourself with http://alt.example.com, and redirect external requests for http://www.example.com/alt to the subdomain, while internally mapping it to the directory /alt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.