Forum Moderators: phranque

Message Too Old, No Replies

redirects and subdomains

         

pknag

4:12 am on Jul 17, 2006 (gmt 0)

10+ Year Member



I modified my .htacess to redirect my entire domain to a new address.
It reads:

redirect 301 / [newsite.com...]

Now, my old site is properly redirecting when I type in [olddomain.com...] but is not redirecting when I type in [olddomain.com....]

Please help, I am new at this.

Thanks

jdMorgan

6:09 pm on Jul 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From what you're saying, I suspect your site has a 'control panel' which is also used for configuring the server.

In this case, you'll need to use the control panel to either redirect the www domain to the new site, or to 'point' requests for www.old-domain to the same directory as non-www.old-domain so that your new code can then redirect the www.old-domain requests to the new domain.

In other wordw, your new redirect code is not being executed for www.old-domain requests, so you need to find and fix that problem, or use the control panel to redirect www requests directly without using your new code for that.

Hope that makes sense, it's hard to talk about...

Jim

[edited by: jdMorgan at 6:10 pm (utc) on July 17, 2006]

pknag

1:47 pm on Jul 18, 2006 (gmt 0)

10+ Year Member



Thanks, I went into DNS tools on godaddy and pointed the www subdomain to the New URL. I'm not quite sure why I had to do this - but the site is forwarding correctly now.

jdMorgan

3:29 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I'm not quite sure why I had to do this

Probably because www.example.com and example.com are two different domains, which need not resolve to the same Web site. Therefore, each of them must be redirected to the new domain.

Although it is common for Web hosting to be set up so that www.example.com and example.com resolve to the same Web site, this is not required. Historically, example.com would be used for internal corporate use, while www.example.com would be used to reach the public portion of the site.

So, you had to redirect them separately.

Jim

pknag

11:21 am on Aug 3, 2006 (gmt 0)

10+ Year Member



I'm puzzled because this is not working again. I am getting below error when I type in www.domain.com but am correctly redirected to www.newdomain.com when I type in domain.com.

The CNAME record is modified in DNS manager on godaddy to point www to www.newdomain.com


Forbidden
You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

Apache/1.3.33 Server at AppStuff Port 80

jdMorgan

1:48 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might be better off pointing both
www.olddomain.com and olddomain.com to your old server, then redirect to newdomain.com from there.

Try adding an A record (not a CNAME) for www.oldomain.com or use a 'wildc-card' A record to catch both the domain and *any* subdomains, including "www". That is, use "*.olddmain.com. 12.34.56.78" in the A record.

Alternately, you could point all variations of olddomain.com to newdomain.com, and then use mod_rewrite to check the requested hostname on newdomain.com. If a request arrives for *.olddomain.com, 301-redirect it to newdomain.com.

Your problem description trips my "screwed-up host" detector, and you might want to work with your host(s) to resolve this issue -- That might be faster than trying to work trough it here.

Jim