Forum Topic: odd redirect issue

Forum: .htaccess Forum : General • Posted by RememberToForget • Updated:

Um, redirects have proven to be much more elusive than I would have ever expected. Here’s the thing. If I put the redirect in htaccess, for example:

RedirectMatch 302 (?i)/bad


Redirect 302 /bad

It’ll work fine when I go to test it out by typing in the address bar, BUT, it never (or rarely) seems to work when I go to any referer site that has the same link on it. I click it, and sure enough, even with cache disabled, the redirect doesn’t happen and I get 404’ed.

So far, dealing with URL’s on other people’s sites has been the most frustrating. Is there anything I’m missing, anything I need to know about this?

2 Replies to “odd redirect issue”

Posted by Jeff Starr

There is a wide variety of factors involved with HTTP requests, so it’s difficult to just try and guess.. but, one thing I’ve seen time and time again are hosts with their own weird, idiosyncratic rules in place. For example, just last night a client had asked his host why HTTP requests weren’t making it off the server. His host replied that there “is nothing that would prevent outgoing HTTP requests on our servers.” So I did a reverse traceroute and provided evidence that, indeed, the requests were getting blocked at the server level. After we presented the evidence to the host “support” team, they informed us that they did actually have a blacklist/filter in place that was blocking some outgoing requests.

All that to say this: ask your host, but don’t necessarily take their response as the gospel truth; often “support” staff are just lazy and know that most customers have no idea what’s going on.

Posted by RememberToForget •

Well, I’m lucky in that regard. My hosting company is just one guy, he knows everything about everything, and his main downside is just occasional moodiness.

Thanks for the heads up, I didn’t think about asking him.