Log in

View Full Version : Server inconsistent with domain name and/or root folder designation



djr33
01-03-2014, 02:31 AM
This is a followup to my other thread, now with a lot more information and a deeper/different problem.
http://www.dynamicdrive.com/forums/showthread.php?76176-htaccess-mod-rewrite-inconsistent-on-reload




I use GoDaddy and I've set my domain thebrb.com to go to a directory in the root called thebrb.com/. Simple enough. It also works consistently. Check the homepage (or any other) to confirm that.

But something is very wrong when a page is missing. The server'sdefault 404 page is shown below by a link to a non-existent location:

Here's a demo page:
http://thebrb.com/nopage

Note that I have no 404 page setup on that site. On other sites on the same server I do have 404 pages and they load either way, both times. (404 with .htaccess works, for the record.)

So the fact that I don't have a 404 page actually is helpful. Now I can see what's wrong.


In my previous thread, I explained that .htaccess with mod_rewrite was inconsistent on the server-- it worked about half the time and inconsistently on reloading. I had no idea what was causing it, and I was pretty sure my .htaccess code was correct. Well, I was right. Something is very wrong at the server level:


Reload the demo page several times, paying close attention to the "requested URL"
I get either:

/thebrb.com/nopage
OR:

/thebrb.aom/nopage
Note the very subtle change in the main (domain-level) directory.

To be clear: this is a shared hosting account where "/" is my root directory. These are subfolders I created and associated with the domains by using GoDaddy's default "select a folder for this domain" setting.

Other domains do the same thing; I've checked. Often the "." gets replaced by a random letter.

This is incredibly weird, and I think I should give GoDaddy tech support a call.

But first... any ideas?



What ends up happening is the following:
1. 404 pages do weird things. No big deal, and in fact I can cover that up by a custom 404 page, which for whatever reason works consistently.
2. .htaccess with mod_rewrite works about half of the time, I assume when the directory structure would be correct on the 404 page.
3. .htaccess with mod_rewrite completely fails when it appears to be going a level deeper, at least with some settings. So if I'm using a/index.php to handle requests for all subdirectories such as "a/b/c/" then I get a permanent 404 (with randomly changing URL like this) that never loads to the page it should be-- the server seems to be having a fit because the page doesn't exist, even though .htaccess is supposed to be catching that.


I'm about ready to switch hosts. This is unacceptable. And it's going to be very complicated to explain to tech support.

Nile
01-03-2014, 02:57 AM
This seems extremely odd. I wouldn't even call technical support about this, email them. The people you're talking to will normally have no idea what they're talking about anyways. I'd email them immediately.

Something you could try in the meantime is create a custom 404 page that dumps all the server/header information and see if anything changes as the com/aom/bom/dom/etc... change in the requested URL.

djr33
01-03-2014, 03:17 AM
That's a good point. It's usually a 30+ minute wait time for calling anyway. GoDaddy is in general reliable (and cheap) but their tech support is no fun.


Something you could try in the meantime is create a custom 404 page that dumps all the server/header information and see if anything changes as the com/aom/bom/dom/etc... change in the requested URL. Not sure what you mean. As far as I can tell, this is consistent (well, consistently inconsistent) regardless of the request, assuming I can actually see it. If a real page (or a custom 404 page) is served, then it doesn't seem to maintain this. The only time it matters is when no page is found either a default 404 or due to .htaccess attempting to serve a different file for one that doesn't exist.

Nile
01-03-2014, 03:36 AM
Well something needs to be happening that instigates this weird variation of the first letter in com. So far I've seen a multiple random letters, and one time even a period instead of a letter. I'm wondering if you can track the changes and see what factors influence the change. I guess it doesn't matter that much.

Also, I can't recreate this behavior on thebrbforum.com. Do you have a different htaccess file there?

djr33
01-03-2014, 03:47 AM
Yeah, something is going on. No idea what.
Generally from what I've seen it looks like an alternation. But it might be more than that, or for all I know it could vary by requesting IP. It's very odd. For the other domains, I noticed especially the period being replaced (x.com becoming something like xccom) or the first or last letters. No idea if that's a pattern. And anyway, I can't fix it. I will see if GoDaddy can.


Also, I can't recreate this behavior on thebrbforum.com. Do you have a different htaccess file there? Weird!
http://www.thebrbforums.com/nopage -- I see the same thing. No changing (reported) URL.

No .htaccess on either of those sites, actually.

On other sites I get the same behavior. I noticed it (originally) for ci-pro.com (see my signature) for .htaccess problems, but then only much later connected the dots to figure out that this was the cause. And there I have a custom 404 page so you can't do this test. But it did alternate all the time for .htaccess mod_rewrite stuff, so I'm sure that's what was happening. I just had no idea.

You can also test it at:
ouraccent.com
lingkit.com
[No links because I don't want those indexed yet. They're in progress, long term development.]

It was definitely happening at lingkit.com earlier, but I can't get it to do it now (this was actually where I first noticed the bug, trying to get some .htaccess settings worked out-- I changed the directory to lingkit from lingkit.com to see if the dot was a problem, and it wasn't-- it kept changing things around after that, even though it seems to have stopped). And at the moment (didn't check earlier) ouraccent.com is also not doing it.

Nile
01-03-2014, 04:01 AM
I'm noticing the issue on lingkit. The slash is changing. On ouraccent, "ouraccent" is becoming "ouraccest" (or variations of the 'n' in accdent). I'm sure godaddy will definitely appreciate you pointing out this bug. According to their website help pages on htaccess, they recently updating Apache. That could be this instigator.

djr33
01-03-2014, 04:09 AM
How odd. It's inconsistent either over time or for different users. That's nonsense.

How recently? I've been aware of this problem (via .htaccess inconsistencies) for a while now, since the summer I think. But at that point, it was an abrupt change-- the site had been working flawlessly for years. At first I thought just part of my .htaccess code was broken on my personal website, which wasn't a priority. Now that I had the time to fix that and change some other things around I'm digging up all kinds of 'fun' surprises.


Edit: in following up a bit I came across this:
http://support.godaddy.com/help/article/6945/issues-with-serverside-includes-and-htaccess-files
It wouldn't be too surprising if something else is an issue too, but remember that I'm not actually using .htaccess for the links we're talking about now, so I don't know what's going on. Something odd, though.

Nile
01-03-2014, 04:14 AM
How recently?

Not sure, but on this page (http://support.godaddy.com/help/article/6945/issues-with-serverside-includes-and-htaccess-files) it talks about a recent update. I'm sure it must have been an update prior to that one though if it's been occurring on your site for that long. Also interesting (and wondering if you can confirm): the letter replacement usually occurs around the 8-9th character and is more prominent and random when going to something like "thebrb.com/thebrb.com" or "lingkit.com/lingkit".

traq
01-03-2014, 04:15 AM
1. can you post your current htaccess files (especially if you have one in (what used to be) your main domain's site root)?

2. can you post your account's directory structure?

3. if you contact goDaddy, ask if you can see the apache config files for your sites (you don't need to access them; just a copy of their contents would be extremely helpful—but I still don't know if they'd be willing).

4. What admin panel does goDaddy use? cPanel? Parallels? something else?

djr33
01-03-2014, 04:38 AM
Not sure, but on this page it talks about a recent update. I'm sure it must have been an update prior to that one though if it's been occurring on your site for that long.Hm, right, ok. But it might have been the last one.

Also interesting (and wondering if you can confirm): the letter replacement usually occurs around the 8-9th character and is more prominent and random when going to something like "thebrb.com/thebrb.com" or "lingkit.com/lingkit". lingkit isn't doing it for me at the moment, but thebrb is, and thebrb.com/thebrb somehow gives thebrb.bom/thebrb. So odd. It's like find and replace decided to take over my server but wasn't very good at it...


1. can you post your current htaccess files (especially if you have one in (what used to be) your main domain's site root)?
Ok. Let's see:
As discussed in the other thread, I just changed the structure (yesterday) to work out having my "primary" domain in a non-root location. So it's remotely possible that I caused all of this, or at least I expect that's what the tech support people may claim. But I'm confident that I did not, because:
1. There were problems before that, and the problems are specifically why I changed it!
2. I believe that by changing it, I have now uncovered the problems, rather than creating them.
So, I'm operating on the assumption that the changes didn't do anything, that this problem has been around for 3+ months.

My sites have not changed especially significantly recently; my project yesterday was resurrecting lingkit.com after it was down for a long time (no time to work on it for a while, and it was on another server that is no longer up). So that's part of what lead to discovering this.

I'm a bit hesitant to post all of the information here for security reasons. What do you think? I can edit it out later I suppose.


Here's the .htaccess info:
See the other thread for what was going on previously. I was using mod_rewrite to move all requests into the root (my "primary" domain ci-pro.com) into a subdirectory, to keep things organized. That had been working well for a few years, until something changed (an update I expect, nothing I did at all, I hadn't modified it in years) and then the site broke in a few places.

Current root .htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} notarealsubdomain.ci-pro.com
RewriteRule (.*) http://ci-pro.com/
As in the other thread, I figured out to use a fake subdomain as the "primary" domain. This is kind of cheating, but I don't think it hurts anything. I don't ever want anyone to access the root. Also, that subdomain isn't even setup. It just doesn't exist. But it was enough for GoDaddy's domain manager to allow me to switch it for the primary one.
Anyway, all that .htaccess file does is move any traffic (if it ever were to exist) to the real ci-pro.com site.

For ci-pro.com, I also have a .htaccess file like this:

ErrorDocument 403 /404.php
ErrorDocument 404 /404.php
Seems to be working fine.

In a few other places I have .htaccess with mod_rewrite creating dynamic pages. Most seem broken. However, in the forum here: linguistforum.com you can see that it works (with the "pretty URLs for threads" mod), with code that I didn't write myself.

So to some degree .htaccess is working, but I'm 95% sure it's not causing this.

I'm pretty sure what is happening is that bad input (fake/corrupted URLs) are being given to .htaccess, which obviously then ends up with bizarre problems.


2. can you post your account's directory structure?
The root contains several system files and then some directories including:
/lingkit/ (lingkit.com), /cip/ (ci-pro.com), /thebrb.com/, /thebrbforums.com/, /ouraccent.com/, etc.
I tried switching some to the without-a-dot format to see if that would help, but it appears irrelevant.
The root directory also contains that .htaccess file above. Not much else of interest.
Then within each of those directories above, I have my normal index.php files and whatever other content is around.


3. if you contact goDaddy, ask if you can see the apache config files for your sites (you don't need to access them; just a copy of their contents would be extremely helpful—but I still don't know if they'd be willing).Good idea.


4. What admin panel does goDaddy use? cPanel? Parallels? something else? This is shared hosting without anything special. I generally just use FTP (and sometimes phpMyAdmin, available through the GoDaddy website or by saving the URL from there). When I do need to change the configuration of my server (basically adding/changing domains), I use GoDaddy's site with what I think is a proprietary interface. It might be a rebranded version of something. I saw recently that they claim cpanel is available on their new accounts, but maybe I haven't found that option, or more likely it's because my account is several years old, before they had that option. And I don't really want to (or need to) update. (Last time I did, they wiped all of my files. They put them back after someone had the time to get the magnetic tape backup...; I also had backups on my laptop but it was several GB. Aaanyway...)

Is that enough info? I'll provide whatever else might be helpful. (If not in a post, by PM.)

traq
01-03-2014, 07:26 AM
I'm a bit hesitant to post all of the information here for security reasons. What do you think? I can edit it out later I suppose.
I don't think anything you posted is a security risk. But you can delete it now if you wish; I don't see any likely culprits (except the directories-with-dots, but you say you've looked into that, so I believe you).

Only things I can think of:

1. Maybe it just hasn't been long enough for all of your fixes to propagate (though I kinda doubt this).

2. Have you tried removing the htaccess file from the primary domain's former root? I don't see anything wrong with it, but I can't help but think that this might be some kind of htaccess-cascade issue.

If neither of those, then I'm inclined to say it's GoDaddy's problem and "good luck" finding it. (Sorry to be so blunt.) I've heard good things about domain registration with GoDaddy, but (until you) I'd never come across anyone remotely happy with their hosting; not even on the "it's okay if you don't need tech support" level.

I'm sending you a PM.

djr33
01-03-2014, 03:59 PM
except the directories-with-dots, but you say you've looked into that, so I believe youI think I looked into it-- I changed some to directories without dots. One was ci-pro, which was originally ci-pro.com for several years with no problems until the problems started, and playing around with it for a bit I ended up with cip/ instead, which might or might not have been part of a partial solution involving changing some of the code around, for a very temporary fix a few months ago. But in the end, it looks like those with and those without dots are doing the same weird things. I wouldn't be shocked if this is somehow the problem (perhaps that *any* of my sites have dots in them still? I haven't tried removing all of them), but it doesn't seem like it's the problem in any simple sense.


1. Maybe it just hasn't been long enough for all of your fixes to propagate (though I kinda doubt this).I am always concerned about this because it's impossible to know if it's been long enough, but I also kinda doubt that.
One possibility (albeit an odd one) is that the alternation is due to multiple name servers or something along those lines, with one working and the other not working. But at least in the case of ci-pro.com it was months of problems (assuming this really is the cause, which seems to be the case to me), so that would be weird. It's possible, regardless, that it's a settings issue, where it only was set correctly on half of the (whatever does this), but that's a major GoDaddy bug if so.


2. Have you tried removing the htaccess file from the primary domain's former root? I don't see anything wrong with it, but I can't help but think that this might be some kind of htaccess-cascade issue.I'll try that now. I'd like an easier way to deal with that required "primary" domain anyway. Since that subdomain doesn't exist, this is probably not a security concern. I'm still wondering whether it might eventually be automatically created by GoDaddy via my use of it in that way, but it has now been about 3 days so that seems unlikely. If it was going to happen, it would have happened already. I think... but I don't want access to my root folder. This is clearly, unrelated to everything else, an oversight by GoDaddy or perhaps an intentional trick to get us to buy their next-level ultimate domain manager where you can control these things (and, for example, set * subdomains).
Ironically I just renewed my hosting on the 31st because it was expiring, and with some time at this point I was hoping to get some of my sites fixed / further developed. So I hope that wasn't a waste of money.


If neither of those, then I'm inclined to say it's GoDaddy's problem and "good luck" finding it. (Sorry to be so blunt.) I've heard good things about domain registration with GoDaddy, but (until you) I'd never come across anyone remotely happy with their hosting; not even on the "it's okay if you don't need tech support" level.I hope I'm giving a reasonable impression of what I think of GoDaddy-- basically I need a place to put files that has reliable uptime, is reasonably fast, and has enough bandwidth and disk space for a low price. I'm not asking for more than that. Therefore, in that, GoDaddy is just fine most of the time, unless any issues come up, which they rarely do if I'm not trying to do anything particularly special. But of course I was hoping that their "unlimited sites" description on this hosting was not accompanied by all of these weird problems.
One of my sites may eventually require a dedicated server, or at least a higher end one; I wouldn't use GoDaddy for that; it's for the basics, but it usually does work for the basics. For what I'm doing at the moment I wouldn't expect this to be happening.

Anyway, the only real problems I've ever had with GoDaddy are with explaining problems to tech support and getting a reasonable response. It usually works out, just takes a while. If after this I end up moving to a new host, that's fine. I use them for domains so I may as well use them for hosting. But that's all.

djr33
01-03-2014, 05:45 PM
Ok, just to add a bit more info, here's a URL that is still showing problems for lingkit:
http:// www lingkit.com/wiki2/248

So it seems that this has to do with the actual requested URL as much as the server configuration. And it also seems like part of the requested URL is being used to generate the corrupted requested URL, as Nile hinted at before. Weird!!

--
I also have now removed the .htaccess file from the root directory (the others are still there, such as inside ci-pro). It doesn't seem to be making any difference. I renamed it to htaccess.txt, so it should be completely gone. But it might take a while for it to reset. Feel free to take a look. I'm still getting errors here:
http://thebrb.com/nopage



Edit:
It looks like that DID change it, but it didn't FIX it. Now the thebrb.com link above is working for me (I think), but the lingkit one above is still showing errors, but at a different frequency.
This suggests it might be via .htaccess somehow. Weird.
I do have a .htaccess file in that part of the lingkit site, but it doesn't explain why it would be messing up the URL like that.
I wonder if what's happening might be that .htaccess is horribly misconfigured so that by having any .htaccess at all it causes problems. This is obviously still something that needs to be fixed, but at least it is maybe narrowing down the problem??

Here's the lingkit .htaccess in /wiki:

RewriteEngine On
RewriteBase /wiki
RewriteCond %{REQUEST_URI} !^/wiki/index.php$
RewriteCond %{REQUEST_URI} !^/wiki/index.php/
#RewriteRule ^(.*)$ index.php?%{QUERY_STRING} [L]
#RewriteRule ^(.*)$ index.php [L]
Note that I disabled (commented out) the actual rewriting (this was yesterday, I gave up trying to fix that part of the site for a while because of this) so it shouldn't actually be DOING anything. But maybe by having .htaccess it is causing problems?

I'm still looking for pages on other sites that are also having problems...

Edit 2:
Ah, here's a page that still has problems:
http://thebrb.com/nothing/problem
Neither /nothing nor /problem exist.
And there's no .htaccess going on at all (removed in the root, no .htaccess files within /thebrb.com/).
So that can't explain it. It looks like it interacts with .htaccess but isn't caused by it.
It also looks like "more complicated" URLs (or perhaps "more non-existent" multi-level 404 requests) cause more problems...??

traq
01-04-2014, 01:35 AM
RewriteEngine On
RewriteBase /wiki/
RewriteCond %{REQUEST_URI} !^/wiki/index.php$
RewriteCond %{REQUEST_URI} !^/wiki/index.php/
#RewriteRule ^(.*)$ index.php?%{QUERY_STRING} [L]
#RewriteRule ^(.*)$ index.php [L]

responding to various points:

changes to htaccess files are immediate. there's nothing to wait for before your changes take effect.
(When I mentioned "changes not propagated yet" earlier, I was referring to any changes to the actual apache vhost configuration, which is what assigning document roots via goDaddy's CP [should] do. There's no reason those changes shouldn't be immediate as well, but I can imagine them being lazy about it.)

Directory names with dots also shouldn't be a problem (at least, on a Linux server) but again: it's goDaddy. I have no idea what kind of hacky crap they might pull behind the scenes.

Multiple name servers (or maybe load balancers): That's a possibility I hadn't thought of. If there was a problem syncing your changes (or some changes they made, say, three months ago), then that could explain why it's intermittent. Unfortunately, this is something they would have to check (and I doubt they would).

djr33
01-04-2014, 01:41 AM
First, thanks for catching my typo. Actually that appears to be the problem with the lingkit wiki. I was resurrecting some old code (that I DO think worked like that, but maybe I'm wrong) from before this was, for a couple years, on a Windows server.
[There is, if you check it, a big problem with PHP versions, so I need to update some of the code. In the big picture, that's a small problem, which I will deal with later.]

So now it seems like maybe .htaccess is unrelated to the problem, although it can have issues caused by it sometimes.
Of course I do expect it to still have the issue when the server's reported URL is wrong, but since it's inconsistently inconsistent I can't confirm that. At the moment it seems to be working.


As for the rest, strange. What makes the most sense to you as a next step? I suppose I can just set a 404 page for each domain and hope that any issues don't disrupt it like they did before. But I imagine it'll keep being a problem once in a while... inconsistently.


Maybe it's something as simple as their default 404 page having some odd typo in the code. But that wouldn't explain why it (I think) messes with .htaccess sometimes.