Mobile app version of vmapp.org
Login or Join
Radia820

: When you forward a domain permanently via DNS does it keep the underlying URL? I have dealt with using rewrites and rules to forward things in Apache or IIS. I am wondering if I have our

@Radia820

Posted in: #Dns #DomainForwarding #Domains

I have dealt with using rewrites and rules to forward things in Apache or IIS. I am wondering if I have our current domain name test123.com forwarded to test678.com what will happen if someone is going to test123.com/home/products/industrial/product123?

Will it keep the underlying url behind the domain name while being forwarded? Is there anything that I should think about this before deciding? And this is SSL site using cert.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Radia820

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

It depends on your configuration.

Example: Redirect to fixed url

<VirtualHost *:80>
ServerName test123.com
RewriteEngine On
RewriteRule ^.*$ test678.com/? [R=301,L]
</VirtualHost>


This redirects every request to the url test123.com/ and ignores the previous url.

Don't forget the ? at the end of the hostname or the parameter part (everything that follows the ?) will be still appended.



Example: Redirect with uri

<VirtualHost *:80>
ServerName test123.com
RewriteEngine On
RewriteRule ^.*$ test678.com%{REQUEST_URI} [R=301,L]
</VirtualHost>


This sends a Location header with the old request uri intact.



Things to consider

For better google results (SEO) and UX you sould always reduce 404 errors.

If you are migrating to a new servername and the entire file hierachie remains unchanged, I would advise to use the seconds example and keep the uri as is.

If the new server doesn't contain all the old pages and would result into 404 errors you should go with the first option.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme