By rectagon on
I've got Drupal running on my windows server (along with a few other websites) and want to change the Drupal install from the IP url (actually, a no-ip address) to the new domain name. In Joomla all I have to do is change the "live site" in the configuration file. I can't figure out how to do the same in Drupal. Perhaps I'm daft but I haven't been able to figure this out (I don't care to clean the url's either... unless that will help somehow).
Comments
Of course you have to
Of course you have to transfer your database (backup/restore) and your files.
If you have put your settings.php under /sites/youroldsitename.com you have to change that directory name.
Also you must update your settings.php with:
- your new $db_url
- *maybe* your new $base_url
If you are not moving to a subfolder, $base_url can stay disabled with a # in front.
If you haven't made any changes to your .htaccess and all your modules are well behaved you should be done.
Except if your new server has some different requirements that matter.
A possible problem: broken links from modules which save full URLs, or manually entered full URLs.
Move?
If I got you right, you don't want to move anything. Just changing the URL of the same server? In fact, if you're using drupal 4.7 you don't have to do anything as the base url is set automatically. Maybe you have to comment out your base url or enter the new one in the settings file usually located at
drupal_root/sites/default/settings.php.Just need the URL to remain the domain
Hi there. Sorry about the confusion. I was about as clear as mud.
I want my url in the address bar to remain the url of the domain and not the server.
So, my domain is http://www.pcsage.ca and the server address is http://haugan.no-ip.org/pcsage
When someone clicks on the former the url then changes to the latter.
I had tried the base_url line the settings.php file but that didn't seem to work.
What is even more confusing to me is that I can't directly link to a file like
http://www.pcsage.ca/images/pcsage.gif which should be in the same place as http://haugan.no-ip.org/pcsage/images/pcsage.gif it automatically takes me to the main page again.
I have linked my domain to my no-ip address because it's a dynamic IP (not that dynamic so I could just do it manually with the IP if necessary... but I'd rather not).
From what I've read is this a .htaccess file issue?
Higher up from your install try this in a .htaccess file
You are going to have to experiment a bit but this should get you started.
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^haugan.no-ip.org/pcsage$ [NC]
RewriteRule ^(.*)$ http://www.pcsage.ca/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^www.haugan.no-ip.org/pcsage$ [NC]
RewriteRule ^(.*)$ http://www.pcsage.ca/$1 [L,R=301]
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
Hmmmm.
Thanks for that... but it doesn't seem to be working.
I have confirmed the the .htaccess file is functional ... so .... any other ideas? (I'm not a coder. :( ).
Here's the bottom part of the .htaccess file at present.
Any ideas? :)
# Various rewrite rules.
RewriteEngine on
# If your site can be accessed both with and without the prefix www.
# you can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule .* http://www.pcsage.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
# RewriteBase /drupal
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteBase /
RewriteCond %{HTTP_HOST} !^haugan.no-ip.org/pcsage$ [NC]
RewriteRule ^(.*)$ http://www.pcsage.ca/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^www.haugan.no-ip.org/pcsage$ [NC]
RewriteRule ^(.*)$ http://www.pcsage.ca/$1 [L,R=301]
# $Id: .htaccess,v 1.73 2006/04/14 09:08:26 killes Exp $
The logical flaw in the
The logical flaw in the suggested .htaccess IMO is that it *redirects* (permanently even) to http://www.pcsage.ca. And then http://www.pcsage.ca (via DNS) points back to haugan.no-ip.org.
-----
** Edit: In the one you pasted here, the last lines are not processed.
The previous lines say "if it is not a file (!-f) and its is not a directory (!-d), then take this URL and go (L)".
Usually the request is not for a file or a directory, so no more processing is done.
If you want to test hiveminds' .htaccess, put your own lines before those (although as I said I don't expect it to work).
Hmm... I guess you have
Hmm...
I guess you have your http://www.pcsage.ca parked somewhere and you have set up its DNS with a domain pointer to your no-ip.org, where your server and Drupal wait.
If so, the redirection happens where your domain is parked. Your server and Drupal never see your domain name. It has already changed. And it is not possible for a server or a script to show the visitor just any domain name they want. Imagine what would have happened with the net if it was possible.
If its is as I described, you have domain redirection but what you want is domain aliasing (or another trick called cloaking -- something like an invisible frame) so that the initial URL stays... This must be done where you have parked your domain.
Last I checked, zoneedit.com was offering parking, domain pointers and domain aliases (free for your first few domains). If I remember correctly, one problem with domain aliases was that they cannot serve email, so zoneedit advised to use a domain pointers with cloaking instead. But their cloaking was crappy because it was keeping the initial URL (http://www.pcsage.ca) unchanged everywhere on your site, without showing any paths. So, I think only a domain alias will do.
Only then you will be able to set up Drupal for your domain name, because now it never sees your domain name.
Or at least this is my theory...
I see the logic...
I do see the logic and the only way for me to test properly is to still Joomla on temporarily and see if it does what I think it does... or has done in the past. Or I could just live with it being the cheapo that I am. :)
CogRusty is correct the only
CogRusty is correct the only way of doing it is at the DNS server. I was not paying attention to your set up. You might want to consider paying the $25/year to no-ip.org and getting proper cloaking. I did this for two years while running my own server from a PC at home. Never regretted it. You learn so much for so little money.
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
Thanks all
Ya, I'm now pretty sure Netfirms is at fault here and not Drupal. I think if I was using my server root I could work around it. Might be time to upgrade at No-ip. Thanks!