Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

if I own a domainname myweb.com with corresponding hosting, and I also own a domain myweb.net (but no webhosting is setup for this domain), is there a way that I can generically forward myweb.net/anyURL to myweb.com/anyURL, and if so, how can this be done?

share|improve this question
add comment

2 Answers 2

It sounds like what you want to do is domain mirroring, or do you just want to forward from one URL to another?

If you're looking to forward domains, you would want to look at the DNS settings where you registered your domain, or look to see if you have a control panel where you can manage domains and redirections.

If you just want to forward to an external link, you can do this through a plugin, or using an HTML redirection: http://stackoverflow.com/questions/5411538/how-to-redirect-from-an-html-page

share|improve this answer
add comment

Redirecting a domain name to another (including deep links redirecting to deep links) is a very common setup. In fact most redirect rules that you can implement redirect deep links to deep links by default. It is generally harder to set up a redirect that redirects everything to the front page of another site.


Most domain name registrars offer this service free of charge. For example GoDaddy calls this "Forwarding" and it is available under the "Domain Settings" for the domain. I just checked one of my domains that is set up this way and confirmed that deep links do in fact forward to deep links on the other domain.

GoDaddy forwarding


If your web host uses cPanel to allow you to set up your domains, the feature is also called forwarding. See the cPanel documentation on forwarding.


If you have an Apache virtual host set up for the domain that you want to redirect, you can edit your .htaccess or httpd.conf file and put in a redirect rule. Apache redirect rules behave like you want, they forward deep links to deep links.

Redirect permanent / http://example.com/

Finally, if you have both domains being served from a single directory on the server, you can use rewrite rules to redirect one domain to the other. This is the only case in which you have to do something special to get the deep links. The (.*) is a capturing group that is put onto the URL with the $1:

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

Or alternately, redirect anything that isn't example.com to example.com (which handles subdomains and multiple redirect domains in one command):

RewriteEngine On
RewriteCond %{HTTP_HOST} !^example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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