0

Old site: abc.com New site: abc.org

The old site, abc.com, is only a "parked site" now, so there is no .htaccess files any more for that domain name.

So all htaccess rules need to be in the .htaccess file on the new domain name, abc.org.

Can someone please help me with the rules so that all .COM urls gets forwarded to the .URL equivalent URL...??

So for example, if someone goes to abc.com/dir1/dir2/aboutus.php then they will be redirected to the same URL but on the new domain, abc.org/dir1/dir2/aboutus.php

Thanks in advance.

1

What you want to do is Domain Name Forwarding, and it CAN NOT be done using .htaccess of the target domain. If you are using godaddy to register your domain, here is a guide that they have prepared for people who would want to forward one domain to another:

https://ph.godaddy.com/help/manually-forwarding-or-masking-your-domain-name-422

The process is about the same for other domain name registrars. You have 2 options when doing the domain forwarding. One is to keep showing the original domain, such as abc.com in your example. This is Forwarding with Masking. The other option is to forward abc.com to abc.org and the user sees abc.org in the browser. This is Forwarding without Masking.

  • Thanks. hostmonster.com does not offer this option, so I need to abandon setting this up as I had envisioned it. – user3512522 Mar 1 '17 at 15:10
0

Please use following code.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !examplenew.org$ [NC]
RewriteRule ^(.*)$ http://www.examplenew.org/$1 [L,R=301] 

Thanks

  • Thanks Sagar but, unfortunately, this is not working. Here are the contents of my .htaccess file: # Use PHP5.6 as default AddHandler application/x-httpd-php56 .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !newdomain.org$ [NC] RewriteRule ^(.*)$ http://www.newdomain.org/$1 [L,R=301] – user3512522 Feb 28 '17 at 8:01
  • Try this # Use PHP5.6 as default AddHandler application/x-httpd-php56 .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteCond %{HTTP_HOST} !newdomain.org$ [NC] RewriteRule ^(.*)$ http://www.newdomain.org/$1 [L,R=301] </IfModule> – Sagar Prajapati Feb 28 '17 at 8:06
  • Sagar. My apologies. I had cut-and-pasted the wrong .htaccess file. Here is the actual one. Seems like the code that you had sent is already present in the .htaccess file. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> #END WordPress RewriteCond %{HTTP_HOST} ^old_domain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.old_domain\.com$ RewriteRule ^(.*)$ "http\:\/\/www\.new_domain\.org\/$1" [R=301,L] – user3512522 Feb 28 '17 at 8:29
  • Please edit your answer, and add an explanation: why could that solve the problem? – fuxia Feb 28 '17 at 8:42
  • Please don't use the comment section to write long CODE, update the question with new CODE and then update the answer accordingly. – Fayaz Feb 28 '17 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.