By ioo on
I want to move from my current URL to a new one, I have the URL's all pointing to the account. I want to know, if there a way to make the new URL the main one (I know chnage the config file) but still have my old links to work?
Thanks...
Comments
In short...
Is there a way to make
http://www.old-url.com/node/1044
http://www.new-url.com/node/1044
go to the same place.
.htaccess!
Research using .htaccess files. They'll do what you want (and more if you want)!
Has anyone done this, I am scared of .htaccess
I know the simple stuff, but the rest of that scares me...
Unless I misunderstand your
Unless I misunderstand your intentions, you probably don't want to simultaneously preserve two separate URLs leading to the same content. You want everyone to use, circulate, and bookmark the new domain's URLs, while anyone reaching the old ones instantly arrives at the new URL and their browsers are updated for future reference. Right?
Put this your old domain's .htaccess file:
This should make
http://www.old-url.com/anything/and/everything
go to
http://www.new-url.com/anything/and/everything
The [R=301] flag tells Apache to use a 301 redirect (or Permanent redirect) while doing the rewrite, which means that search engines will transfer ranks to the new URI once they've updated their indices.
Check out Apache's URL Rewriting Guide for more examples and info.
*Let us know if it works.
-zach
------------------------
harkey design
: z
Perfect, Thanks!!
Thank you sir!
301
Ahhh, I didn't know about the 301. I'm going to update my .htaccess files.
This is great
This is some great info. The .htaccess file has some provisions for forcing a certain domain, wither with the www or without. For whatever reason, which I can't figure out, my site works much much better when its uniform on way or the other, and best when its with the www. The problem with the default rewrite rule is that you lose everything after the domain if you type a link. So for instance ivoweb.net/gallery would rewrite as www.ivoweb.net After combining this hint here with the default rewrite, I can now get it to keep whats at the end when it makes it www.ivoweb.net.
the default:
Becomes:
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Great!
DanIvo
http://www.ivoweb.net