Forum Moderators: open
No, there is no need to do this. Both of your domains will lead to your current server. On your server, you check to see if the incoming request is not for the current/correct domain name. If not, you 301-redirect to the new domain name - which actually results in another access to your same server, but this time with the correct domain name.
It's counterintuitive, but it works. Here's the code I have used:
RewriteCond %{HTTP_HOST} !^www\.mynewdomain\.com
RewriteCond %{HTTP_HOST} !^123\.45\.67\.89
RewriteRule ^(.*)$ http://www.mynewdomain.com/$1 [R=permanent,L]
Also include your server IP address to allow you access in the event of DNS failure.
This is also useful if you have registered multiple tld's and pointed them to your server, but only wish to promote one of them. If a request for mydomain.org or mydomain.net is received, it redirects to mydomain.com.
Jim
now:
>>Both of your domains will lead to your current server
I follow that :)
>>On your server, you check to see if the incoming request is not for the current/correct domain name.
The incoming request will be for www.myoldsite.com: however, the DNS entry is (apparently) simply a direction toward the IP of www.mynewsite.com using the domain name of www.myoldsite.com. (is this correct understanding as to what is happening when someone clicks on the link?)
>>If not, you 301-redirect to the new domain name - which actually results in another access to your same server, but this time with the correct domain name.
So..we code it so that when the server recognizes it as coming from a request for www.myoldsite.com the server simply redirects it to www.mynewsite.com (the same server).
So..
If
Request is from name www.myoldsite.com
Then redirect request to www.mynewsite.com
?
Where would we make this code change? the webhost guy has been short with me lately and i want to give him specifics...hell, i'd love to just do it myself, but :( unfortunately i don't have that capability yet...however, i love this stuff so much i'm thinking of dropping my anthro/religious studies major and getting into webmastering...
Sorry for being dense ;-)
And thanks so much for your patience :D
Rocky
The code I supplied will fix your problem as it is. Unfortunately, it's for use in the .htaccess file on an Apache server. We'll have to wait for someone to come along to tell you how to do it on IIS. Or you might want to try a WebmasterWorld site search and look for redirection subjects on IIS server.
To make a quote box, either use the "reply with quote" checkbox below, or surround your quote with [.quote]quoted text[./quote] but leave out the two periods.
Jim
Request.Servervariables("SERVER_NAME"): Provides the domain name used to access the site. (pretty sure, going on memory)
Response.Redirect("http://somewhere.com"): sends a message to the browser to redirect to the new URL
Response.Write("<h1>I am the King of all Widgets</h1>"): allows you to write stuff to be displayed as html on the users' screen
Response.write(Request.Servervariables("SERVER_NAME")): inserts the domain name into the html for your testing purposes.
ps your asp code needs to be inserted into brackets like this <% put your code here %>