Forum Moderators: phranque

Message Too Old, No Replies

301 redirect from .com.ar to a .org.ar in the same registrars account

301 redirect from .com.ar to a .org.ar in the same registrars account

         

jimb_ar

12:05 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



I'm trying to do a 301 redirect from a .com.ar domain to a .org.ar domain, hosted in the same registrars account.
Already tried with this code but didn't work:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*oldwebsite\.com.ar$ [NC]
RewriteRule ^(.*)$ http://www.newwebsite.org.ar/$1 [R=301,L]

Any ideas on how to make it work?

Thanks in advance,
Jimbar

[edited by: jdMorgan at 12:36 am (utc) on Feb. 7, 2008]
[edit reason] de-linked [/edit]

wilderness

3:03 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ONLY if you have duplicated the directory structure whereas the NEW matches the OLD.

Place the following in the OLD website

RedirectMatch 301 oldwebsite\.com.ar(.*)$ [newwebsite.org.ar$1...]

jimb_ar

5:20 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



The problem is that there´s no old structure, since the account is still the same. The only change was the domain from mydomain.com.ar to mydomain.org.ar, having both domains within the same account.
Right now the redirect is working because of a directive in the registrars control panel, but I wanted to make it permanent using .htaccess in order to keep the site's positioning, but until now I haven't been able to.

wilderness

5:31 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the old domain name is dead?
There's nothing too redirect.

You might explore one of the registrar free accounts (who ever your domain names are registered with) and see if the FREE offers htaccess.

Then if the old domain is still active, place that website there, for the mere purpose of redirect.

jdMorgan

12:38 am on Feb 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only thing that needs to be present at the "old domain" is the redirect code.

Let's back up a bit, though. Please tell us what you mean by "it doesn't work," since this phrase is so general as to be meaningless.

How did you test?
What were the results?
How did those results differ from your expectations?

Jim

[edited by: jdMorgan at 12:38 am (utc) on Feb. 7, 2008]

jimb_ar

1:31 pm on Feb 7, 2008 (gmt 0)

10+ Year Member



Our company had a .com.ar domain. Two weeks ago we changed the domain to .org.ar, but we still use the same registrar's account to access it.
The .htaccess I applied did not work at all. The old domain is returning a 200 code instead of the 301. What I don't know is if it's not working because of a misspell in the syntax or because of something else, such as there's no way of doing it within the same registrar's account or something like that.

Thanks in advance

jdMorgan

2:59 pm on Feb 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have any other working rewrite rules on the old domain? If not, you can try something simple, like:

Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^foo\.html$ http://www.webmasterworld.com/apache/3566602.htm [R=301,L]

If you install that code on your old domain, and then request /foo.html from your old domain, you should end up back here at WebmasterWorld. If that doens't work, then look at your (old domain) server error log; It may have some very good information telling you what the problem is.

It's not clear what you mean by "registrar's account" -- Your registrar registers your domain name. It may or may not provide your DNS services or a 'domain pointing' service that is essentially a tiny hosting setup that includes only a redirect to another domain (redirect only, no 'Web site' content).

Unless the domains are hosted separately, your Web hosting service must be set up to handle requests for both the old and new domains. Usually, this feature is indicated by the presence of selections for "Add-on domains" in your hosting control panel.

Again, it will be very helpful to use the three-question list above when describing a problem: Otherwise, we may spend a whole day trying to fix your code, only to discover that the problem is in your DNS configuration. When that happens, members' interest level often wanes, distracted by newer threads with more-clearly-described problems. So it's in your best interest to be verbose about how you tested and what happened.

Jim

jimb_ar

12:17 pm on Feb 8, 2008 (gmt 0)

10+ Year Member



I'm sorry. By registrar I meant DNS service host. If I upload the .htaccess example you proposed, it would drive all my traffic (.com.ar domain and .org.ar domain) to this post. And that's the issue i was trying to explain.
Thanks

jdMorgan

2:12 pm on Feb 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's how I'd code that:

RewriteEngine on
#
RewriteCond %{HTTP_HOST} oldwebsite\.com\.ar [NC]
RewriteRule (.*) http://www.newwebsite.org.ar/$1 [R=301,L]

To get accurate test results, you must completely flush your browser cache before testing any changes to your .htaccess or server config files.

This method assumes that the HTTP/1.1 Host header arrives at your server with the correct (old or new) hostname in it, and that your server is configured to recognize both hostnames and deliver them to your 'account' filespace. This will not be the case unless there is a CNAME or A record in your DNS zone file -- Or more accurately, this will not be the case if you use a frame-based domain "pointing" service rather than a proper DNS setup or a redirect-based domain "pointing" service.

Jim