• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Redirecting a Web address/url/etc

theknight571

Platinum Member
Ok... I've been messing with this for awhile now... trying mod_rewrite and redirect but with no luck.

I need to redirect: www.abc.com/subdir/ to www.xyx.com/subdir/

I created an index.htm with a meta refresh tag in it... and if I type the address into the address bar, it redirects like it should.

However, if I send a link to someone it just "redirects" to the www.abc.com homepage.

I'm sure I'm missing something... but can't figure out what.

Environment:

Windows 2003 Server
Apache 2

Any info would be helpful.

Thanks in advance.
 
Are you using mod_rewrite, or trying to do this with plain redirects?

I'm not even sure plain redirects can handle wildcards.
 
Today I tried all kinds of things... but nothing seems to want to work... I assume I'm just missing something.

I played mostly with mod_rewrite.

I'm fairly new at this website stuff... so I'm still learning.

I'll look into CNames.

Any other ideas ??? I have until Monday to figure this out.
 
Originally posted by: theknight571
Today I tried all kinds of things... but nothing seems to want to work... I assume I'm just missing something.

I played mostly with mod_rewrite.

I'm fairly new at this website stuff... so I'm still learning.

I'll look into CNames.

Any other ideas ??? I have until Monday to figure this out.

you should really post specific snippets of code
a rewrite could work, if done properly
 
Since your server is Win2k3 I assume ASP is installed and configured.

<% Response.Redirect("www.xyx.com/subdir/ ") %>
 
Originally posted by: TeamZero
Since your server is Win2k3 I assume ASP is installed and configured.

<% Response.Redirect("www.xyx.com/subdir/ ") %>

I inherited this server and configuration... so I'm not sure where something like that would go.

I have discovered another bit of info....

Our site can be "gotten to" with two different names...

www.XXXabc.com and www.abc.com (sample names)

When you type in www.abc.com it gets translated into www.XXXabc.com before it's displayed... but I can't find where that translation takes place...

Our "network" guys aren't in this weekend... so I might have to wait until Monday morning to figure that out... but I think that anything beyond the www.abc.com gets lost during it's translation.

I.e. I type in www.abc.com/sub and it gets translated into www.XXXabc.com... losing the /sub

So... I think this is where my problem lies.

It they type in www.XXXabc.com/sub/ the index.htm file redirects them successfully... but www.abc.com/sub just dumps them directly to the sites homepage.
 
Change the file extension on your index or default file to .asp if it isn't already, and stick my code anywhere in that file. It's just a server-side redirect.
 
Is that any different than using the meta tag redirect in a regular html file?

(META http-equiv="refresh" content="5;URL=...)

I'm begining to believe that the request isn't getting though the "name change" mentioned above.

But I'll give it a shot... ain't nuthin else worked yet. 😛
 
Originally posted by: theknight571
Originally posted by: TeamZero
Since your server is Win2k3 I assume ASP is installed and configured.

<% Response.Redirect("www.xyx.com/subdir/ ") %>

I inherited this server and configuration... so I'm not sure where something like that would go.

I have discovered another bit of info....

Our site can be "gotten to" with two different names...

www.XXXabc.com and www.abc.com (sample names)

When you type in www.abc.com it gets translated into www.XXXabc.com before it's displayed... but I can't find where that translation takes place...

Our "network" guys aren't in this weekend... so I might have to wait until Monday morning to figure that out... but I think that anything beyond the www.abc.com gets lost during it's translation.

I.e. I type in www.abc.com/sub and it gets translated into www.XXXabc.com... losing the /sub

So... I think this is where my problem lies.

It they type in www.XXXabc.com/sub/ the index.htm file redirects them successfully... but www.abc.com/sub just dumps them directly to the sites homepage.


I know for Apache on Linux (and pretty sure for Apache on Windows), there is a configuration file (typically called httpd.conf) that allows for the configuration you have described. Look for a section called "Virtual Servers"...

I would look there before talking to the network folks (or at least in addition to), as it is a more likely cause of this.
 
Ok... got it figured out...

I was trying to use the correct commands... just in the wrong place.

At some point in the past, our site must have been hosted on a different (centralized) server.

It's on that server that the initial www.abc.com to www.XXXabc.com redirect is taking place.

It took me awhile, but I managed to get logged into that server and change it's .htaccess file.

Now it redirects like a charm.

Thanks to all that helped.
 
Back
Top